-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Closed
Labels
Bugthing that needs fixingthing that needs fixingPriority 0will get attention right awaywill get attention right awayRelease 9.xwork is associated with a specific npm 9 releasework is associated with a specific npm 9 releaseconfig:overridesIssues dealing with the overrides featureIssues dealing with the overrides feature
Description
Opening a new issue since #4232 is getting crowded with other possibly unreleated bug reports. But this one I have confirmed.
From: #4232 (comment)
Note that the INITIAL install will abide by the override rules set, and the subsequent installs (e.g., run npm install twice) will ignore overrides.
I can confirm this is the behavior in the latest npm@8.19.2
. This can be reproduced easily with the following package.json
:
{
"name": "test",
"version": "1.0.0",
"engines": {
"npm": ">=8.3.0"
},
"dependencies": {
"json-server": "^0.17.0"
},
"overrides": {
"json-server": {
"package-json": "7.0.0"
}
}
}
npm install
in the folder containing only the abovepackage.json
--> 0 vulnerabilities- Subsequent
npm install
right after the previous (sonode_modules
andpackage-lock.json
exists) --> 5 vulnerabilities npm update
--> 0 vulnerabilitiesrm -rf node_modules/ && npm install
--> 5 vulnerabilitiesrm package-lock.json && npm install
--> 5 vulnerabilitiesrm -rf node_modules/ && rm package-lock.json && npm install
--> 0 vulnerabilities
From the above it can be concluded that the overrides
property is only honored when running npm install
first time (i.e. without package-lock.json
and node_modules
present) and when running npm update
.
maunzCache, drew-vanta, hayesmaker, mjancarik, JavierPDev and 61 moremelroy89silverwind, melroy89, justinfagnani and jdalton
Metadata
Metadata
Assignees
Labels
Bugthing that needs fixingthing that needs fixingPriority 0will get attention right awaywill get attention right awayRelease 9.xwork is associated with a specific npm 9 releasework is associated with a specific npm 9 releaseconfig:overridesIssues dealing with the overrides featureIssues dealing with the overrides feature