search

Home  >  Q&A  >  body text

node.js - 安装cnpm源时候出这些错误问题,这怎么解决?

安装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
天蓬老师天蓬老师2785 days ago647

reply all(2)I'll reply

  • ringa_lee

    ringa_lee2017-04-17 15:05:12

    Insufficient permission ('permission denied'), sudo npm install -g xxx

    reply
    0
  • 高洛峰

    高洛峰2017-04-17 15:05:12

    It’s not a source issue. It’s because you don’t have permission
    You need to find out the permissions of osx/liunx first
    Users don’t have permission to write to the system directory (/usr/local/lib/node_modules)
    Users can only write~/or/User/你的账户名 Below

    If you have to write to the system directory, enter sudo in front of the command to grant super permissions

    reply
    0
  • Cancelreply