Npm Nodemon:找不到命令

Npm Nodemon:找不到命令,npm,nodemon,Npm,Nodemon,我正在努力在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\

我正在努力在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
。我已经四处寻找,没有任何运气,我还没有找到一个有效的解决办法。感谢您的帮助

  • 不要使用
    gitbash
    终端安装全局npm模块
  • 重新安装node.js/npm和
    npm安装nodemon-g
    如果cmd提示符中的
    其中nodemon
    返回
    信息:找不到给定模式的文件。
  • 如果所有其他操作都失败,请确保文件正在下载,并且位于
    C:\Users\{{YOURUSER}}\AppData\Roaming\npm\nodemon.cmd
    文件夹中
  • 最后,确保windows
    path
    环境变量将文件夹设置为该
    \AppData\Roaming\npm
    文件夹
  • 如果所有其他操作都失败,则可能是输入错误或达到了操作系统的最大环境变量限制(即windows 7的4096个字符)

  • 你在运行windows吗?你能在命令promot中执行
    where nodemon
    吗?我正在运行windows(这里是git bash),where nodemon的输出是
    INFO:找不到给定模式的文件.
    不要在git bash内部运行
    nodemon
    它在命令提示符下不起作用。您是否在git bash内部安装了
    npm nodemon-g
    ?使用cmd提示符安装它