just installed new ubuntu vm to test around with node installed things in this order:
node mongodb-server npm express mongoose
now, trying to create a new app i noticed express cannot be used in the shell. express -v
returns express: command not found
i installed npm like this
curl http://npmjs.org/install.sh | sudo sh
and i installed express this way
npm install express
any ideas?
The Npm command not found error can appear when you install or upgrade npm. On Windows, the cause of this error could be that a PATH or system variable is not correctly set. The error can also occur if you do not have npm or Node. js installed, have an outdated version, or have permission issues.
Express is a web application framework of node js. It offers a range of features for building mobile and web applications - from building a single page, to multipages, and an entire hybrid web application.
Use the following command to install express: npm install express --save.
Starting from express 4.00 you also need to install express generator with:
npm install -g express-generator
Only after this will you be able to run express as a command!
For confirmation see: ExpressJS.com - Migrating to Express 4
npm install express -g
You need to install it globally.
Npm 1.0 installs modules locally by default. So the bash executable lives in /node_modules/bin/
. You can add that folder to PATH
or you can just install express
globally so that it's picked up by PATH
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With