cli
cli copied to clipboard
[BUG] `npm link` does not work correctly with workspaces and `install-strategy=nested`
Is there an existing issue for this?
- [X] I have searched the existing issues
This issue exists in the latest npm version
- [X] I am using the latest npm
Current Behavior
I have two projects
- https://github.com/puppeteer/puppeteer
- https://github.com/GoogleChromeLabs/chromium-bidi
Puppeteer uses this .npmrc
install-strategy=nested. packages/puppeteer-core has the chromium-bidi as a dependency.
The linked package get linked at the top level rather then on the package-level. That mean the downloaded version is always resolved by Node.
Expected Behavior
The linked packages is placed in the correct place packages/puppeteer-core/ and runs the locally linked version.
Steps To Reproduce
- Download
puppeteerandchromium-bidi - Install dependecies in both
- Run
npm run buildin both (will build anything necessary, also prevent's an issue related to linking andpeerDependencieswhere there are type errors) - Run
npm linkinchromium-bidi - Run
npm link chromium-bidiornpm link chromium-bidi -w puppeteer-coreinpuppeteer - Observe that the
packages/puppeteer-core/node_modules/chromium-bidiis the downloaded version and not the symlink one. - Observe that
node_module/chromium-bidiis a symlink tochromium-bidi
Environment
- npm: 10.5.0
- Node.js: 20.10.0
- OS Name: Linux
- System Model Name: -
- npm config:
; "project" config from /usr/local/google/home/nvitkov/puppeteer/.npmrc
access = "public"
install-strategy = "nested"
; node bin location = ~/.nvm/versions/node/v20.10.0/bin/node
; node version = v20.10.0
; npm local prefix = ~/puppeteer
; npm version = 10.5.0