npm ERR! Darwin 15.4.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "eslint"
npm ERR! node v5.5.0
npm ERR! npm v3.8.8
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! at Error (native)
npm ERR! { [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! Please include the following file with any support request:
npm ERR! /Users/Leviathan/lj/npm-debug.log
我一直没有弄清如何安装eslint并运行该行命令:
eslint --init以创建.eslintrc文件。
package.json
运行脚本会自动将node_modules/.bin
包含在你的PATH
中。此外,尽可能避免使用sudo
——如果需要,改变或放宽权限即可。/usr/local/
应该对能够读写其中内容的用户相当宽容。 - Qix - MONICA WAS MISTREATED