npm install depedency tree #201059
-
🏷️ Discussion TypeQuestion BodyWhy can npm install produce different dependency trees on two machines even when package.json is identical, and how can you guarantee identical installs? |
Beta Was this translation helpful? Give feedback.
Answered by
captain-jack-sparrow909
Jul 5, 2026
Replies: 1 comment 1 reply
-
|
Because dependency versions can change if only package.json is used. Commit package-lock.json and use npm ci, which installs the exact locked versions and fails if the lockfile and package.json are out of sync. |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
mjz-eigenlab
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Because dependency versions can change if only package.json is used. Commit package-lock.json and use npm ci, which installs the exact locked versions and fails if the lockfile and package.json are out of sync.