我正在努力在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
。我四处搜寻,没有任何运气,但尚未找到可行的解决方案。任何帮助表示赞赏!
答案 0 :(得分:1)
git bash
终端安装全局npm模块npm install nodemon -g
返回where nodemon
,请重新安装node.js / npm和INFO: Could not find files for the given pattern(s).
C:\Users\{{YOURUSER}}\AppData\Roaming\npm\nodemon.cmd
文件夹中。path
环境变量的文件夹设置为该\AppData\Roaming\npm
文件夹。 path
环境变量限制(例如,Windows 7为4096个字符)