当我尝试安装adonis Cli时出现permison错误

时间:2018-10-06 07:44:48

标签: node.js adonis.js

当我尝试安装adonis Cli时,出现此permison错误:

npm ERR! path ../lib/node_modules/@adonisjs/cli/index.js
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall symlink
npm ERR! Error: EACCES: permission denied, symlink '../lib/node_modules/@adonisjs/cli/index.js' -> '/usr/bin/adonis'
npm ERR!  { Error: EACCES: permission denied, symlink '../lib/node_modules/@adonisjs/cli/index.js' -> '/usr/bin/adonis'
npm ERR!   cause: 
npm ERR!    { Error: EACCES: permission denied, symlink '../lib/node_modules/@adonisjs/cli/index.js' -> '/usr/bin/adonis'
npm ERR!      errno: -13,
npm ERR!      code: 'EACCES',
npm ERR!      syscall: 'symlink',
npm ERR!      path: '../lib/node_modules/@adonisjs/cli/index.js',
npm ERR!      dest: '/usr/bin/adonis' },
npm ERR!   stack: 'Error: EACCES: permission denied, symlink \'../lib/node_modules/@adonisjs/cli/index.js\' -> \'/usr/bin/adonis\'',
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'symlink',
npm ERR!   path: '../lib/node_modules/@adonisjs/cli/index.js',
npm ERR!   dest: '/usr/bin/adonis' }
npm ERR! 
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR! 
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator (though this is not recommended).

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/adroitcoder/.npm/_logs/2018-10-06T07_39_51_484Z-debug.log

1 个答案:

答案 0 :(得分:0)

对于EACCES错误,您应该使用节点版本管理器重新安装npm或手动更改npm的默认目录。

信用:https://docs.npmjs.com/getting-started/fixing-npm-permissions