mac 安装polymer cli Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/polymer-c
Posted hushenao
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了mac 安装polymer cli Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/polymer-c相关的知识,希望对你有一定的参考价值。
安装的时候根据说明,需要使用npm install -g polymer-cli命令,但是一直提示没有权限,
后来增加sudo后提示如下,
Error: EACCES: permission denied, mkdir ‘/usr/local/lib/node_modules/polymer-cli/node_modules/wd/build‘
at Object.fs.mkdirSync (fs.js:905:18)
at sync (/usr/local/lib/node_modules/polymer-cli/node_modules/mkdirp/index.js:71:13)
at Object.<anonymous> (/usr/local/lib/node_modules/polymer-cli/node_modules/wd/scripts/build-browser-scripts.js:6:1)
at Module._compile (module.js:660:30)
at Object.Module._extensions..js (module.js:671:10)
at Module.load (module.js:573:32)
at tryModuleLoad (module.js:513:12)
at Function.Module._load (module.js:505:3)
at Function.Module.runMain (module.js:701:10)
at startup (bootstrap_node.js:194:16)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node scripts/build-browser-scripts`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
查看资料发现,可能需要增加--unsafe-perm,即
sudo npm install --unsafe-perm -g polymer-cli
结果成功了
以上是关于mac 安装polymer cli Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/polymer-c的主要内容,如果未能解决你的问题,请参考以下文章
Worklight CLI 未在 mac 中启动 Giving Error