這次帶給大家怎樣處理Mac內安裝nmp淘寶鏡像失敗,處理Mac內安裝nmp淘寶鏡像失敗的注意事項有哪些,下面就是實戰案例,一起來看一下。
安裝指令如下:
npm install -g cnpm --registry=https://registry.npm.taobao.org --verbose
#提示報錯,訊息如下:
npm ERR! Darwin 16.6.0 npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "cnpm" "--registry=https://registry.npm.taobao.org" "--verbose" npm ERR! node v6.11.0 npm ERR! npm v3.10.10 npm ERR! path ../lib/node_modules/cnpm/bin/cnpm npm ERR! code EACCES npm ERR! errno -13 npm ERR! syscall symlink npm ERR! Error: EACCES: permission denied, symlink '../lib/node_modules/cnpm/bin/cnpm' -> '/usr/local/bin/cnpm' npm ERR! at Error (native) npm ERR! { Error: EACCES: permission denied, symlink '../lib/node_modules/cnpm/bin/cnpm' -> '/usr/local/bin/cnpm' npm ERR! at Error (native) npm ERR! errno: -13, npm ERR! code: 'EACCES', npm ERR! syscall: 'symlink', npm ERR! path: '../lib/node_modules/cnpm/bin/cnpm', npm ERR! dest: '/usr/local/bin/cnpm' } npm ERR! npm ERR! Please try running this command again as root/Administrator. npm verb exit [ -13, true ] npm ERR! Please include the following file with any support request: npm ERR! /Users/xxx/npm-debug.log
注意到這一句提示:
Please try running this command again as root/Administrator
於是將指令最後改為如下所示,成功安裝
sudo npm install -g cnpm --registry=https://registry.npm.taobao.org --verbose
相信看了本文案例你已經掌握了方法,更多精彩請關注php中文網其它相關文章!
推薦閱讀:
以上是怎樣處理Mac內安裝nmp淘寶鏡像失敗的詳細內容。更多資訊請關注PHP中文網其他相關文章!