I am attempting to use Cloud9 IDE for the first time, and start a node.js project using the express module. I am able to install the module, but when I attempt to run the command
express ./myProjectHere
it's says
Command 'express' was not recognized
npm works, why doesn't express after installation?
Select the Run Panel to set the run configurations as follows:
name: express
path: node_modules/express/bin/express
cmd line args: ./your-app-name
Just remember to double click the express line item in the run panel after you have entered the command information.
Cloud9 IDE has some temporary locks on the run functionality within the IDE. If you attempt to open the run panel, and the fields are disabled then follow the following steps:
There are some additional steps, such as setting up dependencies, that I have covered in greater detail here:
Hope this helps those who were seeing the same strange issues I was!
You can install Express using the following in the Cloud9 terminal at the bottom of the Cloud9 IDE:
npm install express
and a simple hello world app that works on Cloud9 is:
var express = require('express');
var app = express();
app.get('/', function(req, res){
res.send('hello world');
});
// Note: Uses the CLOUD9 port
app.listen(process.env.PORT);
As listed on the Features page on the Cloud9 site itself, the IDE now supports installing express through npm, and running express just like on your own machine.