NPM Commands Reference (Node Package Manager)

NPM is called Node Package Manager, which makes sharing of code easier for Javascript Developers. NPM gets installed on your Machine, when you install Node.

Visit Here to install Node JS for your specific target:

Using NPM JS Developers can make packages (or sometimes Modules) out out Code that they have developed, and publish in NPM registry.  Other Developers can discover npm packages from these Registries and can download and reuse your code. Its very easy to version the packages and also keep track of the updates to NPM packages.

Packages or Modules are similar to what we call as Libraries in C and C++ world. So Similar to how Developers link to C, C++ libraries, they include these NPM packages/Modules. Usually packages are build to solve a very specific problem (such as package to accessing a database); So these specific packages are combined with more specific packages and, that’s how a bigger application is built in JS world.

You can read more about NPM here and Getting Started with NPM Here.

Here are my Most used NPM Commands, I regularly update and use them as my CheatSheet:

FUNCTIONALITY COMMAND EXAMPLE OUTPUT
Check Node Version node -v # node -v
v4.4.5
Check NPM Version npm -v # npm -v
3.9.3
Update NPM sudo npm install npm -g
Find the path to npm’s directory npm config get prefix   npm config get prefix
/opt/node

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *

mautic is open source marketing automation