-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
[BUG] npm install cannot update the lock file #7085
Comments
The error is because you're pinning deps and thus creating an incompatibility; your package.json should have |
That was the team's decision to pin dependencies. We want to be sure that at any time we get the same version of the libraries. Is dependency pinning not supported by |
@ljharb IMO this is a perfectly valid scenario. NPM support pinning dependencies like this and it is even illustrated by the fact that it works great without |
Of course pinning is supported. @nZeus the lockfile guarantees that; pinning in package.json doesn’t achieve anything whatsoever, @tomachristian the issue here is that all the angular packages aren’t pinning, and if you pin, you have to update them all at once. In other words, the problem is that the ecosystem doesn’t pin, you’re using something that declares a peer dep (angular, in this case), and the very problem you’re running into would be avoided by not pinning. You certainly can solve it while still pinning, it’ll just be a lot more work and it’s harder to explain how over text. |
I am also running into this issue regularly and my solution is usually to delete the package-lock.json and node_modules, then run However, disregarding the pinning discussion above, it is still an issue. The error that @nZeus posted above shows that NPM still finds Why does |
@nZeus did you find a proper way to solve this? We are running into the same issue with Renovate where we also decided on pinning the versions in the |
Is there an existing issue for this?
This issue exists in the latest npm version
Current Behavior
Hi,
We are trying to upgrade some libraries, using the renovate bot:

but when the

npm install
command is executed, it fails to update the package-lock.json file.We get the following error:
If I manually delete the

package-lock.json
file andnode_modules
folder, and then run thenpm install
command, it works:Any ideas why it fails?
Expected Behavior
No response
Steps To Reproduce
No response
Environment
The text was updated successfully, but these errors were encountered: