What is the practical difference between npm install
and npm update
? When should I use which?
Node.js – npm install vs. update – what’s the difference
node.jsnpm
Related Topic
- Javascript – How to completely uninstall Node.js, and reinstall from beginning (Mac OS X)
- Node.js – How to update each dependency in package.json to the latest version
- Node.js – How to fix npm throwing error without sudo
- Javascript – the difference between Bower and npm
- Node.js – What’s the difference between dependencies, devDependencies and peerDependencies in npm package.json file
- Node.js – the –save option for npm install
- Iphone – remove all objects from a uiview
- Node.js – Do I commit the package-lock.json file created by npm 5
Best Answer
The difference between npm install and npm update handling of package versions specified in package.json:
Summary: The only big difference is that an already installed module with fuzzy versioning ...
npm install
npm update
Additionally:
install
andupdate
by default handle devDependencies differentlynpm install
will install/update devDependencies unless--production
flag is addednpm update
will ignore devDependencies unless--dev
flag is addedWhy use
npm install
at all?Because
npm install
does more when you look besides handling your dependencies inpackage.json
. As you can see in npm install you can ...PATH
) usingnpm install -g <name>
--force