-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Closed
nodejs/node
#41925Labels
Bugthing that needs fixingthing that needs fixingPriority 0will get attention right awaywill get attention right awayRelease 7.xwork is associated with a specific npm 7 releasework is associated with a specific npm 7 release
Milestone
Description
Is there an existing issue for this?
- I have searched the existing issues
Current Behavior
In a workspaces based environment, for example:
.
+-- package.json
`-- packages
+-- a
| `-- package.json
`-- b
`-- package.json
Running npm install b --workspace a
will no longer install the locally linked package correctly. Instead, it'll use the version hosted on npm
, or throw a 404 if you use a custom (unique) package name.
Expected Behavior
In <7.20.x, NPM would resolve the local package, and correctly alter package.json and package-lock.json.
Steps To Reproduce
With node v16.6.1
and npm 7.20.3
installed:
- Make a new directory
mkdir ./npm-install-debug
- Add a package.json
cd ./npm-install-debug
npm init -y
- Setup 2 workspace packages
npm init -w ./packages/a
npm init -w ./packages/b
(I used @rijk/a
and @rijk/b
as names, to avoid confusion with the existing packages a
and b
.)
- Run
npm install
in the root, to give it a chance to npm link all the packages (not sure if needed)
npm install
- Try installing
@rijk/b
as a dependency of@rijk/a
npm install @rijk/b -w @rijk/a
- See error...
npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/@rijk%2fb - Not found
npm ERR! 404
npm ERR! 404 '@rijk/b@*' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/rijkvanzanten/.npm/_logs/2021-08-10T20_07_25_648Z-debug.log
If you install 7.20.2
or below (npm i -g [email protected]
), the above flow still works as expected.
Environment
- OS: macOS 11.4, also seen in GitHub Actions
- Node: v16.6.1
- npm: 7.20.3 and up
nickrum, alvis, simllll, rijkvanzanten, triepl and 39 morealvis, orvn and darwin403ryanio, darwin403 and manuferna1985
Metadata
Metadata
Assignees
Labels
Bugthing that needs fixingthing that needs fixingPriority 0will get attention right awaywill get attention right awayRelease 7.xwork is associated with a specific npm 7 releasework is associated with a specific npm 7 release