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)

👋 Kindness is contagious

Explore a sea of insights with this enlightening post, highly esteemed within the nurturing DEV Community. Coders of all stripes are invited to participate and contribute to our shared knowledge.

Expressing gratitude with a simple "thank you" can make a big impact. Leave your thanks in the comments!

On DEV, exchanging ideas smooths our way and strengthens our community bonds. Found this useful? A quick note of thanks to the author can mean a lot.

Okay