-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Import error with install-strategy=linked
and namespaced packages in a workspace
#6122
Comments
install-strategy=linked
and namespaced packages in a workspace
It's not just the namespace that's omitted... the symlink in I have some packages with a prefix for the names, like |
Exactly. The symlink should be named after the full package name. Now it's named after the forder name of each workspace. Which is irrelevant. |
So Other than this, linked installs look like they solve a lot of problems for us and I'm excited to try it out when it's ready. |
Is there any hope of getting this addressed or prioritized? |
Indeed it's very strange bug and should be prioritized. |
EDIT: The workaround a posted seems to result in deleting the folder contents on 'npm i' |
Hi, just following up, is this going to be looked at in the near term? |
I'm also running into this. The version of npm we're using is |
Is there an existing issue for this?
This issue exists in the latest npm version
Current Behavior
The namespace is being dropped when linking workspace packages which results in them not being found when attempting to import from them.
I've made a minimal repro here: https://github.com/iansu/npm-linked-install-repro
I have two packages in a workspace in this repo:
@iansu/package-a
@iansu/package-b
@iansu/package-b
has a dependency on@iansu/package-a
When no install strategy is specified this is what the root
node_modules
directory looks like:In this case nothing is installed in
package-b
'snode_modules
directoryWhen
install-strategy=linked
is specific this is what the rootnode_modules
directory looks like:Additionally this is what
package-b
's `node_modules directory looks like:When I try to import from
@iansu/package-a
I get an error because neithernode_modules/@iansu/package-a
orpackages/package-b/node_modules/@iansu/package-a
existExpected Behavior
The contents of
node_modules
should include the namespace and produce a tree similar to the one produced when not usinginstall-strategy=linked
Steps To Reproduce
npm install --install-strategy=linked
cd packages/package-b
node index.js
If you delete
node_modules
and runnpm install
again withoutinstall-strategy=linked
you will not get the import errorEnvironment
The text was updated successfully, but these errors were encountered: