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.

npm is the package manager shipped with .

npm can be used to install and publish and ECMAScript modules as well as JavaScript-based CLI programs. See the npm homepage for more information.

npm has the ability to install packages to a local directory or globally with the -g flag. Global packages are generally CLI programs.

npm packages manage dependencies and pass information to npm through the file. It contains entries for package name, version, git, dependencies, and other information. The official documentation can be found here.

npm uses the system. This system promote three version stages as well as suffixes. For example, v1.2.3-alpha. npm supports modifiers such as asterisks and greater/less than signs when specifying dependencies. More information can be found here and here.

As of April 14, 2015 npm also supports private modules that can be defined and used only by users who you specify. More about private modules here.

npm comes bundled with the installation of NodeJS, so there is no need for a separate install.

To search for modules:

Documentation Links:

Useful links:

49337 questions
5155
votes
20 answers

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 these changes made in npm? What is the difference…
Fizer Khan
  • 88,237
  • 28
  • 143
  • 153
3001
votes
14 answers

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
  • 34,780
  • 9
  • 39
  • 55
2931
votes
35 answers

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 This prints a cryptic error: npm version This prints the package version on the registry (i.e., the…
Laurent Couvidou
  • 32,354
  • 3
  • 30
  • 46
2827
votes
17 answers

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 peerDependencies, which is closely related and might…
Vitalii Korsakov
  • 45,737
  • 20
  • 72
  • 90
2687
votes
42 answers

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 the easiest way to do this? The best way I know is…
Raine Revere
  • 30,985
  • 5
  • 40
  • 52
2386
votes
14 answers

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's similar to yarn.lock and composer.lock, both of…
rink.attendant.6
  • 44,500
  • 61
  • 101
  • 156
2104
votes
65 answers

How can I update Node.js and NPM to their latest versions?

I just installed Node.js and NPM (Node Package Manager). 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. How do I upgrade Node.js, NPM, and my…
Dail
  • 21,261
  • 3
  • 16
  • 5
2062
votes
7 answers

NPM vs. Bower vs. Browserify vs. Gulp vs. Grunt vs. Webpack

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 download the dependencies and don't know how to build…
VB_
  • 45,112
  • 42
  • 145
  • 293
1899
votes
8 answers

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.
Games Brainiac
  • 80,178
  • 33
  • 141
  • 199
1720
votes
35 answers

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 time in one bash terminal): nvm…
Dominic Tancredi
  • 41,134
  • 7
  • 34
  • 50
1485
votes
39 answers

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 this is a permissions issue? I am already the…
Chad
  • 18,076
  • 8
  • 31
  • 41
1456
votes
23 answers

Where does npm install packages?

Can someone tell me where can I find the Node.js modules, which I installed using npm?
trnc
  • 20,581
  • 21
  • 60
  • 98
1399
votes
23 answers

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 . I have installed a few modules that I do not use any more and I just want to get them off. I have a few questions regarding this: Do we have…
Manish Kumar
  • 15,269
  • 5
  • 18
  • 27
1378
votes
23 answers

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 server. So far so good. However, I would like to be able to run something like…
arnemart
  • 14,180
  • 3
  • 17
  • 11
1209
votes
18 answers

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 --save and -dev keywords?
nfort
  • 12,234
  • 3
  • 13
  • 13
1
2 3
99 100