Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you install Express module into a Cloud9 project?

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?

like image 492
Nathan Tregillus Avatar asked Dec 12 '22 02:12

Nathan Tregillus


2 Answers

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.

like image 101
Bill Avatar answered Dec 22 '22 00:12

Bill


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:

  1. Open the Project Files Panel
  2. Drill into the node_modules\express\bin directory
  3. rename the express file to express.js
  4. Open the file you just renamed by double clicking it.
  5. Now open the run pane, and everything but the command line args will be pre-populated for you.
  6. Last, enter the app path you want (I.E. ./your-app-name)

There are some additional steps, such as setting up dependencies, that I have covered in greater detail here:

Express Node To the Cloud

Hope this helps those who were seeing the same strange issues I was!

like image 39
Nathan Tregillus Avatar answered Dec 21 '22 22:12

Nathan Tregillus