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:
npm install express g from a command prompt.c:\source\node> mkdir newapp.c:\source\node> cd newapp.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
express --sessions myapp
This doesn't work for me
express --sessions --css stylus myapp
Fortunately you can add stylus support manually in your generated app. Open up app.js and in the app.configure function, 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 jade and npm install stylus.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With