Skip to content
Advertisement

Unable to run node app.js file

I am learning node.js and I am trying to run the app.js file using the command node app.js but the bash returns nothing (no errors either). Here are the steps I followed:

$ brew install node

$ sudo npm install -g express

$ sudo npm install -g express-generator

after i get into a new folder I created I run

$ express testsite --hogan -c less

$ cd testsite && npm install

Finally

$ node app.js // returns no errors but nothing back except new command line…

Any help on this would be great.

Thanks!

Advertisement

Answer

try npm start from testsite directory.

look at the package.json

scripts : { start : node bin/www }

So you must execute the www under the bin directory.

So instead of node app.js use node bin/www

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement