2

So, I'm working on a node project where the prior developer gave instructions that if the application is not building correctly to simply run npm uninstall (without any options or parameters) then re-run npm install.

So, I understand how npm install works, but I can't seem to find any reference to what npm uninstall will do if it's not passed any parameters or options. The documentation on npmjs doesn't provide any help here and I haven't been able to come up with anything in any of my searches.

It does look like it does something (sometimes) but all the node modules appear to still be all there as if nothing was done. I can't just delete the node_modules directory because we have some custom modules added under the node_modules directory not referenced in the package.json.

Any/all help and guidance appreciated.

rup
  • 123
  • 1
  • 10
  • `npm uninstall` expect to receive a package as argument. check [here](https://github.com/npm/npm/blob/latest/doc/cli/npm-uninstall.md) – Carloluis Mar 14 '18 at 19:49
  • Just remove `node_modules` and do `npm install` and be done with it. – rtn Mar 14 '18 at 20:07
  • @ralphtheninja As I mentioned, I can't wipe the node_modules directory because it includes modules that are custom and not included in the package.json – rup Mar 14 '18 at 20:36
  • That sounds terrible. How can you maintain that in the long run I don't understand :) – rtn Mar 14 '18 at 20:38
  • But either way, it sounds like the `npm uninstall` isn't a useful command....and my research implies that there isn't a straightforward way to uninstall comprehensive components outside of npm prune (will look further into that one to see though). – rup Mar 14 '18 at 20:38
  • @ralphtheninja not saying it is a good design, just what we inherited from the prior developer – rup Mar 14 '18 at 20:38
  • @rup I hear you. Maybe you should spend some time into improving it. Might save some time and frustration down the line. – rtn Mar 14 '18 at 21:44

1 Answers1

0

I would look in the package.json for scripts: { "uninstall" }. The developer might have done something there, that isn't npm specific.