Skip to content

Deps are not resolved correctly when server runs in npm workspace #1970

@gidra5

Description

@gidra5

Impress and Node.js versions

3.0.15 and v18.12.1

Platform

Linux RomanNotebook 5.15.133.1-microsoft-standard-WSL2 #1 SMP Thu Oct 5 21:02:42 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

Describe the bug

When creating monorepo using npm workspaces all deps are installed into node_modules folder at the root of workspace.
But impress resolves dependencies relative to package root only, so it can't find anything

To Reproduce

mkdir test
cd test
git clone [email protected]:metarhia/Example.git
echo "{  "name": "my-workspaces-powered-project",  "workspaces": ["Example" ] }" > package.json
cd Example
npm i
npm start

observe error as on the screenshot - metautil is not loaded because resolved incorrectly and breaks startup

Expected behavior

should resolve dependencies relative to workspace root if inside npm workspace

Screenshots

image

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions