[BUG] Inconsistency between npm install
and npm audit fix
for name
in package-lock.json
#4608
Open
2 tasks done
Labels
Bug
thing that needs fixing
Priority 2
secondary priority issue
Release 8.x
work is associated with a specific npm 8 release
Is there an existing issue for this?
This issue exists in the latest npm version
Current Behavior
npm install
andnpm audit fix
make inconsistent changes to the package-lock.json, causing unnecessary differences for that file.npm install
does not include aname
for the""
packages
entrynpm audit
includes aname
This means that running
npm audit
adds aname
property, and a subsequentnpm install
run removes it again.Expected Behavior
npm install
andnpm audit fix
should behave consistently. Either both should create aname
property, or neither of them should create it.Steps To Reproduce
ℹ️ indicates observed behavior.
❌ indicates unexpected observed behavior.
npm-audit-test
package.json
file with the following content:npm install
package-lock.json
fileℹ️ It has the following content:
npm audit fix --force
package-lock.json
file❌ It has the following content; note the extra
name
property for the""
packages
entrynpm install
againpackage-lock.json
file❌ The
name
property was removed againEnvironment
The text was updated successfully, but these errors were encountered: