命令:npm install -g express 7 verbose parsed url host: null, 7 verbose parsed url port: null, 7 verbose parsed url hostname: null, 7 verbose parsed url hash: null, 7 verbose parsed url search: null, 7 verbose parsed url query: null, 7 verbose parsed url pathname: 'express’, 7 verbose parsed url path: 'express’, 7 verbose parsed url href: ‘express’ } 8 silly lockFile f3c62de4-express express 9 verbose lock express C:\Program Files\nodejs\cache\f3c62de4-express.lock 10 silly lockFile f3c62de4-express express 11 error Error: Attempt to unlock express, which hasn’t been locked 11 error at unlock (C:\Program Files\nodejs\node_modules\npm\lib\cache.js:1434:11) 11 error at cb (C:\Program Files\nodejs\node_modules\npm\lib\cache.js:925:5) 11 error at C:\Program Files\nodejs\node_modules\npm\lib\cache.js:942:20 11 error at C:\Program Files\nodejs\node_modules\npm\lib\cache.js:1420:7 11 error at C:\Program Files\nodejs\node_modules\npm\node_modules\lockfile\lockfile.js:167:38 11 error at OpenReq.Req.done (C:\Program Files\nodejs\node_modules\npm\node_modules\graceful-fs\graceful-fs.js:144:5) 11 error at OpenReq.done (C:\Program Files\nodejs\node_modules\npm\node_modules\graceful-fs\graceful-fs.js:64:22) 11 error at Object.oncomplete (fs.js:107:15) 12 error If you need help, you may report this entire log, 12 error including the npm and node versions, at: 12 error http://github.com/npm/npm/issues 13 error System Windows_NT 6.2.9200 14 error command “C:\Program Files\nodejs\\node.exe” “C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js” “install” "-g" “express” 15 error cwd C:\Users\ASUS 16 error node -v v0.10.28 17 error npm -v 1.4.9 18 verbose exit [ 1, true ]
Install the executable. The executable’s major version will match Express’s:
$ npm install -g express-generator@3 Create the app:
$ express /tmp/foo && cd /tmp/foo Install dependencies:
$ npm install Start the server:
$ npm start
Express4 版本的问题,具体看https://github.com/visionmedia/express