Node.js package manager (npm)

If you installed Node.js using the installer from the Node.js website, you will already have npm installed.

Also, if you followed the instructions to build from the source, you will probably have installed npm. If that is a yes, very good! If no, please do so now. For this, I recommend that you follow the instructions mentioned in the npm installation documentation (https://github.com/isaacs/npm/).

You can check if you have npm installed by typing the following command:

$ npm -v

This should display the version of npm installed.

For those who are wondering what npm is and why you would need a package manager for Node.js, npm is just what its name says; it provides an infrastructure in Node.js to distribute and manage packages. As I said earlier, Node.js is very modular. Node.js apps are built using many modules and third-party packages because npm provides an easy way of adding and managing third-party dependencies for our applications. We will see more on its use in a while.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset