-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Closed
Labels
Bugthing that needs fixingthing that needs fixingNeeds Triageneeds review for next stepsneeds review for next stepsRelease 8.xwork is associated with a specific npm 8 releasework is associated with a specific npm 8 release
Description
Is there an existing issue for this?
- I have searched the existing issues
[BUG] npm install removes linked packages, npm link replaces linked package contents #2380 seems similar but is a 7.x bug and predates the--install-linksoption.
This issue exists in the latest npm version
- I am using the latest npm
Current Behavior
Installing a package with --install-links false, deleting node_modules, then running npm install reinstalls the module as a link and updates package-lock.json
Expected Behavior
npm install should honor and not change package-lock.json, the package should be copied, not linked
Steps To Reproduce
- git clone https://github.com/oshi97/install-links.git
- cd parent
- npm i --no-install-links ../child
- ls -l node_modules
- cat package-lock.json
- rm -Recurse -Force node_modules
- npm install
- ls -l node_modules
- cat package-lock.json
At step 4: d---- 2022-12-14 12:21 PM child
At step 5:
"node_modules/child": {
"version": "1.0.0",
"resolved": "file:../child",
"license": "ISC"
}
},
"dependencies": {
"child": {
"version": "1.0.0"
}
}
At step 8: l---- 2022-12-14 12:23 PM child -> <REPO>\child\
At step 9:
"node_modules/child": {
"resolved": "../child",
"link": true
}
},
"dependencies": {
"child": {
"version": "file:../child"
}
}
Environment
- npm: 8.19.2
- Node.js: 18.12.1
- OS Name: Windows 11
- npm config:
; node bin location = C:\Program Files\nodejs\node.exe
; node version = v18.12.1
; npm local prefix = <REPO>\parent
; npm version = 8.19.2
; cwd = <REPO>\parent
; HOME = <HOME>max-sixty, ath0mas, original001 and manuartero
Metadata
Metadata
Assignees
Labels
Bugthing that needs fixingthing that needs fixingNeeds Triageneeds review for next stepsneeds review for next stepsRelease 8.xwork is associated with a specific npm 8 releasework is associated with a specific npm 8 release