我收到以下錯誤安裝eslint:ESlint錯誤的命令行安裝
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文件
我仍然得到同樣的錯誤,第一個命令,並且不能運行eslint --init之後, 爲CHOWN ......當我在它的終端輸入該行我得到: CHOWN:用戶:非法用戶名 如果我把我的用戶名,而不是CHOWN我仍然得到同樣的錯誤: -bash:用戶名:找不到命令 – wqu
添加了另一個可能的解決方案作爲一個編輯 – user3772314
我是新來使用終端,所以你的鏈接和答覆的建議是有點混淆,所以我應該在終端中逐行輸入,因爲我不斷收到-bash權限被拒絕,命令未找到,或者沒有這樣的文件或目錄時,嘗試那些建議 – wqu