Questions tagged [npm]
npm is the package manager shipped with Node.js. It can be used to install and publish CommonJS and ECMAScript modules, jQuery plugins, reusable JavaScript code (libraries), JavaScript-based CLI programs, and more.
50,300
questions
5401
votes
22
answers
1.9m
views
What's the difference between tilde(~) and caret(^) in package.json?
After I upgraded to the latest stable node and npm, I tried npm install moment --save. It saves the entry in the package.json with the caret ^ prefix. Previously, it was a tilde ~ prefix.
Why are ...
3094
votes
16
answers
1.2m
views
What is the --save option for npm install?
I saw some tutorial where the command was:
npm install --save
What does the --save option mean?
3018
votes
32
answers
2.2m
views
Find the version of an installed npm package
How can I find the version of an installed Node.js or npm package?
This prints the version of npm itself:
npm -v <package-name>
This prints a cryptic error:
npm version <package-name>
...
2924
votes
17
answers
1.0m
views
What's the difference between dependencies, devDependencies, and peerDependencies in NPM package.json file?
This documentation answers my question very poorly. I didn't understand those explanations. Can someone say in simpler words? Maybe with examples if it's hard to choose simple words?
Also added ...
2811
votes
42
answers
1.7m
views
How can I update each dependency in package.json to the latest version?
I copied package.json from another project and now want to bump all of the dependencies to their latest versions since this is a fresh project and I don't mind fixing something if it breaks.
What's ...
2484
votes
15
answers
1.1m
views
Do I commit the package-lock.json file created by npm 5?
npm 5 was released today and one of the new features include deterministic installs with the creation of a package-lock.json file.
Is this file supposed to be kept in source control?
I'm assuming it'...
2171
votes
67
answers
2.4m
views
How can I update Node.js and npm to their latest versions?
I just installed Node.js and npm. I installed npm for access to additional Node.js modules. After I installed Node.js and npm, I noticed that neither were the latest versions available.
So my ...
2075
votes
7
answers
310k
views
NPM vs. Bower vs. Browserify vs. Gulp vs. Grunt vs. Webpack [closed]
I'm trying to summarize my knowledge about the most popular JavaScript package managers, bundlers, and task runners. Please correct me if I'm wrong:
npm & bower are package managers. They just ...
1909
votes
8
answers
332k
views
What is the difference between Bower and npm?
What is the fundamental difference between bower and npm? Just want something plain and simple. I've seen some of my colleagues use bower and npm interchangeably in their projects.
1765
votes
36
answers
2.9m
views
How do I completely uninstall Node.js, and reinstall from beginning (Mac OS X)
My version of node is always v0.6.1-pre even after I install brew node and NVM install v0.6.19.
My node version is:
node -v
v0.6.1-pre
NVM says this (after I install a version of node for the first ...
1517
votes
23
answers
1.3m
views
Where does npm install packages?
Can someone tell me where can I find the Node.js modules, which I installed using npm?
1511
votes
40
answers
704k
views
How to fix npm throwing error without sudo
I just installed node and npm through the package on nodejs.org, and whenever I try to search or install something with npm, it throws the following error unless I sudo the command. I have a feeling ...
1460
votes
25
answers
1.1m
views
Sending command line arguments to npm script
The scripts portion of my package.json currently looks like this:
"scripts": {
"start": "node ./script.js server"
}
...which means I can run npm start to start the ...
1415
votes
24
answers
1.6m
views
How can I uninstall npm modules in Node.js?
As commonly known, any npm module can be installed by running a simple command: npm install <module_name>.
I have installed a few modules that I do not use any more and I just want to get them ...
1269
votes
18
answers
515k
views
What is the difference between --save and --save-dev?
What is the difference between:
npm install [package_name]
and:
npm install [package_name] --save
and:
npm install [package_name] --save-dev
What does this mean? And what is really the effect of --...