DEV Community

Cover image for Useful npm commands 👩‍💻
aryan015
aryan015

Posted on

Useful npm commands 👩‍💻

Just doing my work

  1. longhand - shorthand - description
  2. npm init - no short - initial npm repo (front-end and back-end)
  3. npm install <package-name> - npm i <pn> - install any package
  4. npm install -g <pn> - npm i -g <pn> - install package globally
  5. npm uninstall <pn> - npm un <pn> - uninstall local package
  6. npm un -g <pn> - npm un -g <pn> - uninstall global package
  7. npm uninstall -D <pn> - npm un -D <pn> - uninstall dev depedency
  8. npm -version - npm -v - check npm version
  9. npm outdated - no shorthand - list all local outdated packages (requires update)
  10. npm outdated -g - no shorthand - list all global outdated packages (required update)
  11. npm update <pn> - npm up <pn> - update particular package
  12. npm update - npm up - it will update all the packages mentioned in package.json
  13. npm update -g - npm up -g - update all the global packages
  14. npm list <pn> - npm ls <pn> - check version for particular package
  15. npm list - npm ls - list all package along with their version (except global)
  16. npm list -g <pn> - npm ls -g <pn> - list particular global package
  17. npm list -g - npm ls -g - list all global packages along with their version
  18. npm install <pn>@latest - npm i <pn>@latest - update to the latest version for particular package
  19. npm run <script> - no shorthand - run a script defined in the package.json file.

Thank You for the support ❣

Top comments (0)