安装cnpm源时候出这些错误问题,这怎么解决?
npm ERR! Darwin 15.6.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "cnpm" "--registry=https://registry.npm.taobao.org"
npm ERR! node v6.8.0
npm ERR! npm v3.10.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! 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/wscart/npm-debug.log
高洛峰2017-04-17 15:05:12
不是來源問題。是你沒權限
osx/liunx 權限你先搞清楚
使用者是沒有權限寫入到系統目錄的(/usr/local/lib/node_modules)
使用者只有寫入~/
or/User/你的账户名
下面
如果非要寫入到系統目錄就要在指令前面輸入sudo 賦予超級權限