DEV Community

jastuccio
jastuccio

Posted on

NPM commands

Just some NPM commands I had to look up.

What NPM packages are installed?

  • List your global npm packages: npm list -g
    • dropping the -g flag will list packages in the current directory

Removing NPM packages

  • Remove a package: npm r <name>

  • Remove extraneous packages and packages that are not listed on the parent package's dependencies list: npm prune <name> (see npm prune docs)

  • Uninstall all npm packages (stack overflow): rm -rf node_modules && npm cache clean && npm install

Top comments (0)