【发布时间】:2018-10-27 04:19:04
【问题描述】:
我正在努力在我的 node.js 服务器上安装 nodemon。我正在运行命令npm install nodemon -g,输出如下:
C:\Users\Stoffe\AppData\Roaming\npm\nodemon -> C:\Users\Stoffe\AppData\Roaming\npm\node_modules\nodemon\bin\nodemon.js
> nodemon@1.18.5 postinstall
C:\Users\Stoffe\AppData\Roaming\npm\node_modules\nodemon
> node bin/postinstall || exit 0
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4
(node_modules\nodemon\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"} )
+ nodemon@1.18.5
updated 1 package in 9.223s
但问题是,当我执行nodemon index.js 时,我收到错误bash: sudo: command not found。我四处寻找没有任何运气,但我还没有找到一个可行的解决方案。任何帮助表示赞赏!
【问题讨论】:
-
你在运行windows吗?你能在命令提升中做一个
where nodemon吗? -
我正在运行windows(这里是git bash),
where nodemon的输出是INFO: Could not find files for the given pattern(s). -
不要在 git bash 中运行
nodemon=_= -
在命令提示符下也不起作用
-
你在 git bash 中
npm install nodemon -g了吗?使用 cmd 提示符安装它