I
I
ikerya2017-06-22 13:26:57
linux
ikerya, 2017-06-22 13:26:57

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

1 answer(s)
K
Konstantin Kitmanov, 2017-06-22
@ikerya

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 --savein the project folder.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question