node.js express app creation equivalent in Windows 7
Problem
I'm following this tutorial on node.js and express.
The author is on a UNIX machine. To create the app skeleton with express, jade, and stylus, the author says to run the command
./node_modules/express/bin/express -t jade -c stylus
However, I'm on a Windows 7 machine, so this command doesn't work. ./node_modules/express/bin/express jade stylus
doesn't do what is desired either.
What is the equivalent of the author's command for Windows PowerShell?
Solution
Express can be installed "globally". That means that the OS will create a link to express
in the command line that will run the express application creator.
Just add a -g
option while installing and then call express
directly without the path to node_modules
:
C:\project>npm install express -g
C:\project>express --sessions --css stylus --ejs myapp
I recommend you to follow the official guide: http://expressjs.com/guide.html. The tutorial you're following is for Express 2.* and Express 3 changed a bit.
Discussion
View additional discussion.