Current Behavior:
After installing the dependencies in an npm workspace for the first time, running npm install a second time changes the package-lock.json:
- Some dependencies are removed from it
- The "name" field of the sub-packages is set (it wasn't present on the first install)
Expected Behavior:
Running npm install right after creation of the package-lock.json shouldn't change it.
Steps To Reproduce:
You can reproduce with the following repo: the last commit contains the package-lock.json created by the first npm install --legacy-peer-deps call.
git clone https://github.com/targos/npm-workspace-lock.git
cd npm-workspace-lock
npm install
git diff


Environment:
- OS: Windows 10
- Node: 15.7.0
- npm: 7.5.1
Current Behavior:
After installing the dependencies in an npm workspace for the first time, running
npm installa second time changes the package-lock.json:Expected Behavior:
Running
npm installright after creation of the package-lock.json shouldn't change it.Steps To Reproduce:
You can reproduce with the following repo: the last commit contains the package-lock.json created by the first
npm install --legacy-peer-depscall.Environment: