NPM Commands Cheat Sheet

Here is a cli commands cheat sheet for NPM command, you can use this as a quick reminder for basic commands with a brief description for each of the commands.

What is NPM command?

Add some data here

        ---
tags: [ packaging ]
---
# Every command shown here can be used with the `-g` switch for global scope

# To install a package in the current directory:
npm install 

# To install a package, and save it in the `dependencies` section of `package.json`:
npm install --save 

# To install a package, and save it in the `devDependencies` section of `package.json`:
npm install --save-dev 

# To show outdated packages in the current directory:
npm outdated

# To update outdated packages:
npm update

# To update `npm` (will override the one shipped with Node.js):
npm install -g npm

# To uninstall a package:
npm uninstall 

# To set the `authToken` using env variable `NPM_TOKEN`:
npm config set //npm.intra/:_authToken=\${NPM_TOKEN}
    

Check out the NPM command documentation .


You can also check our MegaSh cheatsheet tool, that has 150+ searchable linux cheat sheets in one page, so you never forget a command as you work again

Check Also

Best AI tools list