Skip to main content

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.

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 ...
Fizer Khan's user avatar
  • 91.3k
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?
Dmitri's user avatar
  • 35.8k
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> ...
Laurent Couvidou's user avatar
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 ...
Vitalii Korsakov's user avatar
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 ...
Raine Revere's user avatar
  • 32.7k
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'...
rink.attendant.6's user avatar
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 ...
Dail's user avatar
  • 21.9k
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 ...
VB_'s user avatar
  • 45.5k
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.
Nafiul Islam's user avatar
  • 81.8k
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 ...
Dominic Tancredi's user avatar
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?
trnc's user avatar
  • 21.3k
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 ...
Chad's user avatar
  • 18.3k
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 ...
user avatar
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 ...
Manish Kumar's user avatar
  • 15.4k
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 --...
nfort's user avatar
  • 12.8k

15 30 50 per page
1
2 3 4 5
3354