由于我使用的是 Express.js,所以我不能npm install
正常使用了。我总是必须扎根才能让它工作......
假设我生成了一个项目
express --sessions --css css
当我尝试做npm install
之后,我遇到了这些错误
npm WARN package.json application-name@0.0.1 No README.md file found!
npm ERR! Error: EACCES, open '/Users/Arnaud/.npm/e7d16cae-express-3-1-1.lock'
npm ERR! { [Error: EACCES, open '/Users/Arnaud/.npm/e7d16cae-express-3-1-1.lock']
npm ERR! errno: 3,
npm ERR! code: 'EACCES',
npm ERR! path: '/Users/Arnaud/.npm/e7d16cae-express-3-1-1.lock' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! System Darwin 12.3.0
npm ERR! command "node" "/usr/local/bin/npm" "install"
npm ERR! cwd /Users/Arnaud/Sites/test
npm ERR! node -v v0.10.2
npm ERR! npm -v 1.2.15
npm ERR! path /Users/Arnaud/.npm/e7d16cae-express-3-1-1.lock
npm ERR! code EACCES
npm ERR! errno 3
npm ERR! stack Error: EACCES, open '/Users/Arnaud/.npm/e7d16cae-express-3-1-1.lock'
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /Users/Arnaud/Sites/test/npm-debug.log
npm ERR! not ok code 0
但是如果做 a sudo npm install
,一切都很好......知道为什么吗?