Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
June 21, 2021 04:22 pm GMT

10 npm Commands that every developer must know

NPM stands for Node Package Manager and it is the package manager for the Node JavaScript platform. It put modules in place so that node can find them, and manages dependency conflicts intelligently. Most commonly, it is used to publish, discover, install, and develop node programs.

Some Important npm commands every developer should know are:

1) npm i
Here i stands for install. It installs all the packages
mentioned in package.json.

2) npm install -production
It installs all the packages mentioned in package.json, except
the dev dependencies.

3) npm i lodash
It installs a package with name of "lodash", you can use your
favorite package name.

4) npm install --save-dev lodash
It installs the specific package as a dev dependency, in my case
the name is "lodash".

5) npm list
It lists the versions and name of all dependencies in the current
directory.

6) npm update
It updates all the production packages in the current directory.

7) npm install -g nodemon
It installs a package globally on your machine, with -g flag. In
my case, nodemon will be installed globally.

8) npm remove lodash
It uninstalls / removes a previously installed node module in the
current directory.

9) npm -v
It displays the npm version installed on your system.

10) npm doctor
It checks our environment so that our npm installation has what
it needs to manage our JavaScript packages.

Thanks for reading!


Original Link: https://dev.to/gurshehzadsingh/10-npm-commands-that-every-developer-must-know-4gmn

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To