Closed
Description
Current Behavior:
npm i some-package
fails if run in a workspace package that depends on another workspace package. The error is that the other workspace package is not found in the registray:
npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/other-package - Not found
Here other-package
is a private package in the same workspace.
You also can't add a dependency manually and run npm i
in the root of the workspace due to #1984
So there appears to be no way to add new dependencies in a workspace, aside from deleting the top-level node_modules folder and package-lock.
Expected Behavior:
npm i
inside a workspace package should update the package.json file and install the dependency.
Steps To Reproduce:
- In a workspace with packages
a
andb
, witha
depending onb
- Do an initial install at the workspace root to set everything up
- cd to
packages/a
- Run
npm i {some-package}
- See error...
Environment:
- OS: macOS
- Node: 15
- npm: 17.0.5