12

I run npm install to install my dependencies.

At the first time, some package install failed.

I ran npm install again.

Will npm reinstall every dependency again or just the package not be installed?

asked Nov 1, 2016 at 6:17
3
  • 1
    Why not just test this? The answer is it checks for updates and only installs what is missing or needs to be / can be updated. Commented Nov 1, 2016 at 6:22
  • @Stian At first time, I know some packages has been installed in node_modules directory. But at second time, will npm replace the packages which existed? Commented Nov 1, 2016 at 6:41
  • no, only if it needs to. Commented Nov 1, 2016 at 6:41

2 Answers 2

21

Running npm install apart from the first time installs only the missing packages and those that need update.

As per stian's input, refer docs.npmjs.com/cli/install#algorithm

Lin Du
104k138 gold badges340 silver badges574 bronze badges
answered Nov 1, 2016 at 6:29
Sign up to request clarification or add additional context in comments.

Comments

0

Running npm install after the first time only installs missing packages or updates existing ones.

tanmoy
1,5861 gold badge13 silver badges35 bronze badges
answered Sep 20, 2022 at 7:45

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.