NodeJS require a global module/package

I’m trying to install globally and then use forever and forever-monitor like this:

npm install -g forever forever-monitor

I see the usual output and also the operations that copy the files to the global path, but then if I try to require("forever"); I get an error saying that the module wasn’t found.

I’m using latest version of both node and npm and I already know about the change that npm made in global vs local install, but I really don’t want to install localy on every project and I’m working on a platform that doesn’t support link so npm link after a global install isn’t possible for me.

My question is: why I can’t require a globally installed package? Is that a feature or a bug? Or am I doing something wrong?

PS: Just to make it crystal clear: I don’t want to install locally.

9 Answers
9

Leave a Comment