我得到了这个代码。我用的是Mac电脑。我已经安装了npm。我是管理员。我做错了什么?我已经搜索了好几个小时了。
Matts-MacBook-Pro-3:Start Matt$ npm install express-generator -g
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/express-generator
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules
/usr/local/lib
└── express-generator@4.13.1
npm ERR! Darwin 14.5.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "express-generator" "-g"
npm ERR! node v5.3.0
npm ERR! npm v3.3.12
npm ERR! path /usr/local/lib/node_modules/express-generator
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall access
npm ERR! Error: EACCES: permission denied, access '/usr/local/lib/node_modules/express-generator'
npm ERR! at Error (native)
npm ERR! { [Error: EACCES: permission denied, access '/usr/local/lib/node_modules/express-generator']
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'access',
npm ERR! path: '/usr/local/lib/node_modules/express-generator' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! Please include the following file with any support request:
npm ERR! /Users/Matt/Start/Start/npm-debug.log
Matts-MacBook-Pro-3:Start Matt$ 发布于 2015-12-26 11:16:54
请尝试清除npm缓存,然后再次尝试npm安装。您可以使用以下命令来清除npm缓存。
npm cache clean <path to express-generator>有时,即使在ssh上也会出现此错误,npm注册表可能配置为对npm包使用不同的注册表,并且该注册表可能没有快速生成器。
https://stackoverflow.com/questions/34468124
复制相似问题