polymer-cli安装
-
安装命令:
npm install -g polymer-cli
-
执行后安装失败
$ npm install -g polymer-cli npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules npm ERR! path /usr/local/lib/node_modules npm ERR! code EACCES npm ERR! errno -13 npm ERR! syscall access npm ERR! Error: EACCES: permission denied, access '/usr/local/lib/node_modules' npm ERR! { Error: EACCES: permission denied, access '/usr/local/lib/node_modules' npm ERR! stack: 'Error: EACCES: permission denied, access \'/usr/local/lib/node_modules\'', npm ERR! errno: -13, npm ERR! code: 'EACCES', npm ERR! syscall: 'access', npm ERR! path: '/usr/local/lib/node_modules' } npm ERR! npm ERR! Please try running this command again as root/Administrator. npm ERR! A complete log of this run can be found in: npm ERR! /Users/wangzhen/.npm/_logs/2018-07-28T12_18_25_662Z-debug.log
-
修改后的执行办法:
$ sudo npm install -g polymer-cli
-
执行后失败:
Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/polymer-cli/node_modules/wd/build' at Object.fs.mkdirSync (fs.js:885: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:652:30) at Object.Module._extensions..js (module.js:663:10) at Module.load (module.js:565:32) at tryModuleLoad (module.js:505:12) at Function.Module._load (module.js:497:3) at Function.Module.runMain (module.js:693:10) at startup (bootstrap_node.js:191:16) npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! wd@1.10.1 install: `node scripts/build-browser-scripts` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the wd@1.10.1 install script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above. ╭─────────────────────────────────────╮ │ │ │ Update available 5.6.0 → 6.2.0 │ │ Run npm i -g npm to update │ │ │ ╰─────────────────────────────────────╯
-
修改后的执行办法
& sudo npm i -g npm
-
执行安装
$ sudo npm install -g polymer-cli /usr/local/bin/polymer -> /usr/local/lib/node_modules/polymer-cli/bin/polymer.js > fsevents@1.2.4 install /usr/local/lib/node_modules/polymer-cli/node_modules/fsevents > node install [fsevents] Success: "/usr/local/lib/node_modules/polymer-cli/node_modules/fsevents/lib/binding/Release/node-v57-darwin-x64/fse.node" already installed Pass --update-binary to reinstall or --build-from-source to recompile > wd@1.10.1 install /usr/local/lib/node_modules/polymer-cli/node_modules/wd > node scripts/build-browser-scripts /usr/local/lib/node_modules/polymer-cli/node_modules/mkdirp/index.js:90 throw err0; ^ Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/polymer-cli/node_modules/wd/build' at Object.fs.mkdirSync (fs.js:885: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:652:30) at Object.Module._extensions..js (module.js:663:10) at Module.load (module.js:565:32) at tryModuleLoad (module.js:505:12) at Function.Module._load (module.js:497:3) at Function.Module.runMain (module.js:693:10) at startup (bootstrap_node.js:191:16) npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! wd@1.10.1 install: `node scripts/build-browser-scripts` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the wd@1.10.1 install script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above. npm ERR! A complete log of this run can be found in: npm ERR! /Users/wangzhen/.npm/_logs/2018-07-28T12_21_07_982Z-debug.log
-
最后的执行办法:
$ sudo npm install --unsafe-perm -g polymer-cli