【问题标题】:nodemon command not found in git bash在 git bash 中找不到 nodemon 命令
【发布时间】:2022-03-24 14:15:27
【问题描述】:

我正在尝试在 Git bash 终端中运行我的 node.js 应用程序。每次我输入nodemon server.js 之前它都有效。最近,我升级了我的 node.js 和 npm。如果我再次尝试在 Git Bash 上运行我的应用程序,则会出现

错误
C:\Users\PC\AppData\Roaming\npm/node_modules/node/bin/node: line 1: This: command not found

出现了。

我尝试使用npm install -g nodemon 卸载和安装nodemon,然后重新安装git,错误仍然存​​在。虽然,nodemon 在 windows cmd 终端上运行良好。

让它在 Git Bash 终端上运行会很好。

【问题讨论】:

    标签: node.js git-bash nodemon


    【解决方案1】:

    也面临同样的问题!但我找到了使用 npx nodemon script.js的方法

    虽然我发现了问题。 Git bash 正在尝试从此目录执行 nodemon:C:\Users\Nayeem\AppData\Roaming\npm/node_modules/node/bin/node

    但是在这个路径中 nodemon 不存在。

    路径应该是C:\Users\Nayeem\AppData\Roaming\npm\node_modules\nodemon

    【讨论】:

      猜你喜欢
      • 2018-03-12
      • 2016-02-13
      • 2016-01-03
      • 2020-10-25
      • 2015-08-26
      • 2019-03-03
      • 1970-01-01
      • 2019-06-26
      相关资源
      最近更新 更多