首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在Mac上的终端中安装express

在Mac上的终端中安装express
EN

Stack Overflow用户
提问于 2015-12-26 10:57:45
回答 1查看 1.7K关注 0票数 0

我得到了这个代码。我用的是Mac电脑。我已经安装了npm。我是管理员。我做错了什么?我已经搜索了好几个小时了。

代码语言:javascript
复制
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$ 
EN

回答 1

Stack Overflow用户

发布于 2015-12-26 11:16:54

请尝试清除npm缓存,然后再次尝试npm安装。您可以使用以下命令来清除npm缓存。

代码语言:javascript
复制
npm cache clean <path to express-generator>

有时,即使在ssh上也会出现此错误,npm注册表可能配置为对npm包使用不同的注册表,并且该注册表可能没有快速生成器。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/34468124

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档