Tonight I decided I’d try to build a simple Node.js application using Express on my Windows 7 machine. The installation went fairly smoothly, but Express refuses to cooperate. Here are the steps I’ve taken:
- Installed Node.js using the MSI available at http://nodejs.org/dist/v0.6.9/node-v0.6.9.msi
- Installed Express by running
npm install express gfrom a command prompt. - Created a directory for the application
c:\source\node> mkdir newapp. - Changed directory to the application directory
c:\source\node> cd newapp. - Ran Express:
c:\source\node\newapp> express --sessions --css stylus.
At this point the node.exe process fires up and runs endlessly at 25% CPU Time and continually uses more memory. After running for 20+ minutes the node.exe process uses 300+ MB of Memory. The express command never completes and the newapp directory remains unaltered.
If I run express --help I see the help output in the console. I’ve tried running the command prompt as and Administrator but still Express appears to hang.
Does anyone have a clue what’s going on or what I’m doing wrong? Thanks in advance!
This is a bug in the Windows version of Node v0.6.9. Filesystem access is pretty much messed up. Rollback to v0.6.8 http://nodejs.org/dist/v0.6.8/node-v0.6.8.msi and you should be fine.
The Express.js command line on Windows doesn’t quite work well either. I just tried with Node v0.6.8.
This works
This doesn’t work for me
Fortunately you can add stylus support manually in your generated app. Open up
app.jsand in theapp.configurefunction, add:app.use(require('stylus').middleware({src: __dirname + '/public'}));Hope this helps!
Update:
Oh ya, don’t forget your NPM commands. In your app directory, you may need to
npm install jadeandnpm install stylus.