Node Package Manager(npm)
Let’s learn how to use the Node Package Manager (npm).
We'll cover the following...
The npm
package is the standard package manager for Node.js. This package is also used in the frontend to manage project dependencies.
How do we use npm?
First, we initialize the project and create a basic package.json
file, like this:
npm init
If a package.json
file already exists, we can install all the project dependencies by running this code:
npm install
To install a single package, we use the following code:
npm install <package_name>
To install a single package globally, we use the following code:
npm install <package_name> -g
...