-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Different runs generate different package-lock.json on npm 7.5.3 #2810
Comments
What happens with npm v7.6.0? |
Seems related to #2700? |
thanks for linking that issue @gavinsharp - it def looks to be related! |
FWIW, we see this (or a similar?) problem when running We can trigger this issue in the following way
|
This was fixed in 7.20.6 (always set name on the root node) https://github.com/npm/cli/releases/tag/v7.20.6 |
Current Behavior:
I have a Node project with some packages, nothing fancy:
I delete the node_modules folder and the package-lock.json file and then run
npm install
to have a fresh install on my dev machine (Windows with WSL2)I then push my code (including package-lock.json) to github and pull that code automatically from a staging server, running Ubuntu 20.04.2.0 LTS.
My deployment script is quite simple and looks like this:
At this stage,
git pull
fails because my previous npm install changed the package-lock.json file on the staging environment and I'm not forcing a pull.When I do a `git diff`` to see what's going on in the staging environment, this is what I get:
It seems the Ubuntu npm is adding "name":"my_package_name" in package-lock.json but not my windows npm. They're both on the same version though!
Expected Behavior:
I expect package-lock.json file not to be changed.
Steps To Reproduce:
Create a new project using Windows 10, npm 7.5.3, npm install the dependencies above, push to a git server, pull from a remote ubuntu 20.04.2.0 environment and npm install it. Do it twice to get the error.
Environment:
The text was updated successfully, but these errors were encountered: