简体   繁体   English

找不到 Nodemon 命令问题

[英]Nodemon command not found issue

I recently update my node.js version and npm and now I am getting a error: $ nodemon C:\Users\username\AppData\Roaming\npm/node_modules/node/bin/node: line 1: This: command not found;我最近更新了我的 node.js 版本和 npm,现在出现错误:$ nodemon C:\Users\username\AppData\Roaming\npm/node_modules/node/bin/node: line 1: This: command not found;

I have tried uninstalling and reinstalling, I am pretty new to using nodemon and node.我试过卸载和重新安装,我对使用 nodemon 和 node 还很陌生。 I have searched the previous questions and tried updating my Path variables but so far nothing has worked.我搜索了之前的问题并尝试更新我的 Path 变量,但到目前为止没有任何效果。

Have you installed nodemon globally or just installed it?您是全局安装了 nodemon 还是只是安装了它? If not, try npm install -g nodemon to install it globally.如果没有,尝试 npm install -g nodemon 全局安装。

If uninstalling and then reinstalling of nodemon module did not work, please try npx nodemon script.js .如果卸载然后重新安装 nodemon 模块不起作用,请尝试npx nodemon script.js I tried it in my VS Code Git Bash terminal and found it working.我在我的 VS Code Git Bash 终端中尝试了它,发现它可以正常工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM