How do you "uninstall" / delete node_modules from NPM ?

4,954 views
Skip to first unread message

Aaron Gray

unread,
Feb 3, 2015, 6:04:03 PM2/3/15
to nod...@googlegroups.com
Hi,

I want a standard way I can delete node_modules directory. npm
uninstall just gives me the message :-

npm WARN uninstall not installed in
C:\Users\Aaron\github\template-node-marionet
te-app\node_modules: "template-node-marionette-app"

Help !

Aaron

Ryan Schmidt

unread,
Feb 3, 2015, 9:03:15 PM2/3/15
to nod...@googlegroups.com
The standard way to delete the node_modules directory is to delete the node_modules directory, using your normal operating system / file manager commands for deleting directories.

Aaron Gray

unread,
Feb 4, 2015, 11:00:54 AM2/4/15
to nod...@googlegroups.com
It would be nice to have a command to do it and also allow script to
delete bower_components as well.
> --
> Job board: http://jobs.nodejs.org/
> New group rules: https://gist.github.com/othiym23/9886289#file-moderation-policy-md
> Old group rules: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> ---
> You received this message because you are subscribed to the Google Groups "nodejs" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to nodejs+un...@googlegroups.com.
> To post to this group, send email to nod...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/nodejs/6AF85345-2958-4764-B60C-83A7C8DD2017%40ryandesign.com.
> For more options, visit https://groups.google.com/d/optout.

Aria Stewart

unread,
Feb 4, 2015, 11:17:48 AM2/4/15
to nod...@googlegroups.com

> On Feb 4, 2015, at 10:22 AM, Aaron Gray <aaronngr...@gmail.com> wrote:
>
> It would be nice to have a command to do it and also allow script to
> delete bower_components as well.

like:

npm install -g rimraf
rimraf node_modules

Though there's "npm rm" and "npm uninstall" to delete single modules.

Bower is entirely orthogonal, so that's up to you to script -- what's the end goal you're working toward?

Aria

Aaron Gray

unread,
Feb 4, 2015, 3:28:51 PM2/4/15
to nod...@googlegroups.com
Thanks !

I am open really Bower maybe the way forward then. I am just more
familiar to npm. I was thinking of doing a patch for npm something
like :-

npm uninstall --force

or something like that. I will look at Bower and if I can get it to
work cross platform across *nix and Windows then I may well use that.
> --
> Job board: http://jobs.nodejs.org/
> New group rules: https://gist.github.com/othiym23/9886289#file-moderation-policy-md
> Old group rules: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> ---
> You received this message because you are subscribed to the Google Groups "nodejs" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to nodejs+un...@googlegroups.com.
> To post to this group, send email to nod...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/nodejs/4D542F90-AB3A-4898-BD0E-8999B77036A0%40nbtsc.org.

Aria Stewart

unread,
Feb 4, 2015, 8:29:29 PM2/4/15
to nod...@googlegroups.com

> On Feb 4, 2015, at 12:45 PM, Aaron Gray <aaronngr...@gmail.com> wrote:
>
> Thanks !
>
> I am open really Bower maybe the way forward then. I am just more
> familiar to npm. I was thinking of doing a patch for npm something
> like :-
>

npm rm and npm uninstall should work -- what are you trying to do exactly?

> npm uninstall --force
>
> or something like that. I will look at Bower and if I can get it to
> work cross platform across *nix and Windows then I may well use that.

Good luck!

Adrian Lynch

unread,
Feb 5, 2015, 11:44:35 AM2/5/15
to nod...@googlegroups.com
Or maybe the last module out the door should take the node_modules folder with it! :D

Aria Stewart

unread,
Feb 6, 2015, 10:22:13 AM2/6/15
to nod...@googlegroups.com

> On Feb 5, 2015, at 1:41 AM, Adrian Lynch <adrian...@concreteplatform.com> wrote:
>
> Or maybe the last module out the door should take the node_modules folder with it! :D

It probably could -- what's the use-case for this?

Aria
Reply all
Reply to author
Forward
0 new messages