nodemon包未安装在nodejs中[重复]

Posted

技术标签:

【中文标题】nodemon包未安装在nodejs中[重复]【英文标题】:nodemon package is not install in nodejs [duplicate] 【发布时间】:2019-11-13 01:40:25 【问题描述】:

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

【问题讨论】:

也许可以试试这个:***.com/questions/54972076/… 我会安装nvm。 Node Version Manager 管理您的全局包,因此它们都驻留在您的主目录中,这意味着您不必使用sudo 来安装它们。 【参考方案1】:

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

sudo npm install -g nodemon

希望对你有帮助!

【讨论】:

是的,Cooper 博士,你是对的,它需要 linux 中的管理员权限。我尝试使用下面的命令,它可以工作。 sudo npm install -g nodemon 是的,谢谢库珀博士。我正在使用 Mac OS,这对我来说非常有用【参考方案2】:

这是一个权限问题,如错误消息所示。您需要修复您的权限或使用sudo。请看:npm throws error without sudo

【讨论】:

以上是关于nodemon包未安装在nodejs中[重复]的主要内容,如果未能解决你的问题,请参考以下文章

NodeJS - NPM 无法安装 nodemon 包

Linux VM/nodejs 问题:Nodemon、Coffee 等未执行

nodejs + nodemon + 永远给我一个错误

nodejs_nodemon

使用nodemon提高nodejs调试效率

NodeJS - nodemon 没有重新启动我的服务器