npm Commands Cheat Sheet

Below are the most common commands used in npm (Node Package Manager)

Install npm & dependencies

npm install

Install npm with the version

nvm install 12

Install Jest Global

npm install -g jest

Delete previous & new installation

rm -rf node_modules && npm install

Install SASS

npm install gulp gulp-sass sass --save-dev

Install Axios

npm install axios --save

Install package

npm i <package>

Uninstall package

npm un <package>

Remove node_modules and re-installing

rm -rf node_modules
rm -rf package-lock.json
npm install

Update package

npm up <package>

Global install package

npm list -g --depth=0

Uninstall a global package

npm -g uninstall <name> 

Upgrade npm


About the author

Naveed Ul-Haq

I am a UK-based Technical Architect, Founder & Technology Evangelist. I'm Optimizely MVP & Optimizely SME on Content Cloud and Commerce Cloud. I love working on .NET-based CMS, eCommerce solutions, .NET Core, DevOps, and Cloud computing. I'm also a Certified Optimizely Content Cloud Developer, Certified Optimizely Commerce Cloud developer, Optimizely B2B Commerce developer and Microsoft Certified Professional in Azure application development. I spend my free time with my family and reading books. You can contact me at

View all posts

Leave a Reply

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