求救,求救,在window8下安装express时,,
发布于 9个月前 作者 smileyang 1065 次浏览

命令: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 ]

7 回复

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

和系统没有关系么?我实在windows下安装的~

我在Win下直接npm install -g express没有问题。你去官网&StackOverFlow看下。

你创建时需要管理员权限么?我使用管理员安装可以安装成功,但是express命令使用不了 …

express用不了是因为你没装express-generator?

npm install -g express-generator

stackoverflow上找的

npm install <packagename> --registry http://registry.npmjs.org/

或者清下缓存

npm cache clean

解决了…没装express-generator…

回到顶部