Answer the question
In order to leave comments, you need to log in
Why is NODEJS module not installed globally on Debian?
Hello. Node installed like this:
curl -sL https://deb.nodesource.com/setup_6.x | bash -
apt-get install -y nodejs Updated
npm like this:
npm install [email protected] -g
Installed the module like this:
npm install express -g
Created a test.js file in the root, in which I asked the node to use (require) the express module. Next, I tried to execute the file with the node test command, but the node said that it could not find the express module:
Error: Cannot find module 'express'
Answer the question
In order to leave comments, you need to log in
Global packages have not been required for 5-6 years, probably since version 0.6 or something like that. They are only used for command line utilities (gulp, grunt-cli, yeoman, express-generator). npm install express --save
in the project folder.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question