Express doesn't work on ubuntu

Viewed 14166

I'm new with nodejs and trying to learn it. I have installed node framework express as global module by command:

$ sudo npm install express -g

This works correctly and I have it in /usr/lib/node_modules. Then I'm creating a new project on express:

 $ express app

But this doesn't create project folder and does not return any error code, clear node code works fine. Anybody knows how to detect and fix this error?

6 Answers

As of Ubuntu 16.04 LTS, the problem occurs when express is installed globally. To fix this, make sure you install express to your working directory even if you have installed globally. Use

sudo npm i express-generator --save

to save it to your working directory in every project you do.

Had this problem and fixed it easily, without having to reinstall nodejs or any other dependency.

Related