Friday, 28 April 2017

Why are my modules not found when installed using npm install -g?

I am building a Node.js app and I need to install some modules. I have a package.json file and when I run npm install, then I can run my server and everything works fine.

I wanted to install my packages globally for some reason, so I ran the command npm install -g. I could see the installation process ongoing but at the end, when I tried to run my server, it couldn't find the modules.

How can I tell my app that the node modules are installed globally so it has to fetch them from I don't what folder ?



via Randy

No comments:

Post a Comment