Assume I install project packages with npm install
that looks into package.json
for modules to be installed. After a while I see that I don\'t need
simple just run
rm -r node_modules
in fact, you can delete any folder with this.
like rm -r AnyFolderWhichIsNotDeletableFromShiftDeleteOrDelete.
just open the gitbash move to root of the folder and run this command
Hope this will help.
Use following command instead of npm install
npm ci
First globally install rimraf
npm install rimraf -g
go to the path using cmd where your node_modules folder and apply below command
rimraf node_modules
I think you're looking for npm prune
npm prune [<name> [<name ...]]
This command removes "extraneous" packages. If a package name is provided, then only packages matching one of the supplied names are removed.
Extraneous packages are packages that are not listed on the parent package's dependencies list.
See the docs: https://docs.npmjs.com/cli/prune
For Windows User, alternative solution to remove such folder listed here: http://ask.osify.com/qa/567
Among them, a free tool: Long Path Fixer is good to try: http://corz.org/windows/software/accessories/Long-Path-Fixer-for-Windows.php
from version 6.5.0 npm supports the command clean-install
to hard refresh all the packages