0

I would like to list some modules that I want to install globally - they are not project related (things like bower, npm-check-updates, ... which I use all the time). Is it possible to manage this with a "global" package.json, or do I need to maintain a separate shell script to perform this installation? Currently I am doing:

# global-npm-pacakges.sh

npm install -g npm-check-updates@1.5.1
npm install -g bower@1.4.1

Any other way of doing this?

blueFast
  • 41,341
  • 63
  • 198
  • 344

1 Answers1

0

Your way is fine but that means you also need to maintain another script to uninstall all of them globally

Using npm install -g with a global package.json, you still have to manage a clean up script. There is no npm uninstall -g based on the package.json. I think you need to npm uninstall name<@version> or npm -R name<@version>

Doing npm -R node_modules is not gracefully way of doing it. It does not clean up the /tmp/xxx

There is some suggestions of using a symlink in this threads for your references: How do I install a module globally using npm?

Community
  • 1
  • 1
hohoho
  • 220
  • 1
  • 3
  • 12