未在nodejs中安装nodemon软件包

时间:2019-07-02 11:56:09

标签: javascript node.js mean-stack

nodemon软件包无法使用nodejs成功安装。我使用了npm install -g nodmon。我在下面收到与权限相关的错误。

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules/nodemon/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

npm ERR! path ../lib/node_modules/nodemon/bin/nodemon.js
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall symlink
npm ERR! Error: EACCES: permission denied, symlink '../lib/node_modules/nodemon/bin/nodemon.js' -> '/usr/bin/nodemon'
npm ERR!  { [Error: EACCES: permission denied, symlink '../lib/node_modules/nodemon/bin/nodemon.js' -> '/usr/bin/nodemon']
npm ERR!   cause:
npm ERR!    { Error: EACCES: permission denied, symlink '../lib/node_modules/nodemon/bin/nodemon.js' -> '/usr/bin/nodemon'
npm ERR!      errno: -13,
npm ERR!      code: 'EACCES',
npm ERR!      syscall: 'symlink',
npm ERR!      path: '../lib/node_modules/nodemon/bin/nodemon.js',
npm ERR!      dest: '/usr/bin/nodemon' },
npm ERR!   stack:
npm ERR!    'Error: EACCES: permission denied, symlink \'../lib/node_modules/nodemon/bin/nodemon.js\' -> \'/usr/bin/nodemon\'',
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'symlink',
npm ERR!   path: '../lib/node_modules/nodemon/bin/nodemon.js',
npm ERR!   dest: '/usr/bin/nodemon' }
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/etech7/.npm/_logs/2019-07-02T11_31_52_856Z-debug.log

2 个答案:

答案 0 :(得分:0)

尝试使用sudo安装它。这是因为您需要管理员权限。

sudo npm install -g nodemon

希望有帮助!

答案 1 :(得分:0)

这是权限问题,如错误消息所示。您需要修正权限或使用sudo。请参阅:npm throws error without sudo