0
我在Mac OS上安裝巴貝爾爲transpiling ES6代碼爲我自己個人項目的麻煩。我輸入了npm install -g babel並返回了這些答案。我不確定這是否相關,但我正在運行node.js v6.9.2。安裝通天transpile ES6代碼錯誤
npm WARN deprecated [email protected]: Babel's CLI commands have been moved from the babel package to the babel-cli package
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules
/usr/local/lib
└── [email protected]
npm ERR! Darwin 16.3.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "babel"
npm ERR! node v6.9.2
npm ERR! npm v3.10.9
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! at Error (native)
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/Colin/npm-debug.log
的錯誤信息是相當多的自我解釋......你需要通天-CLI如果你想CLI命令,而不必到某個文件夾(S) –
寫訪問,我不知道你是怎麼做到這一點的一個McComputer –
你需要'NPM卸載babel',然後再'NPM安裝通天塔,cli'。 – loganfsmyth