Nodemon已安装但无法找到(Nodemon installed but can't be found)

编程入门 行业动态 更新时间:2024-10-27 16:37:15
Nodemon已安装但无法找到(Nodemon installed but can't be found)

我尝试在本地和全局多次卸载和重新安装nodemon:

npm install -g nodemon

(在有和没有sudo情况下尝试过)

它似乎安装没有问题,并给了我:

/usr/local/bin/bin/nodemon -> /usr/local/bin/lib/node_modules/nodemon/bin/nodemon.js /usr/local/bin/lib └── nodemon@1.11.0

但每当我跑

nodemon server.js

在我的应用程序中,我得到;

-bash: nodemon: command not found

就像我提到的那样,我尝试了相同的过程,但本地安装到我的应用程序依赖项,但它似乎没有什么区别。 这里发生了什么? 我在不同的机器上执行相同的过程,它没有问题。

谷歌搜索,我发现一些帖子提到改变/添加PATH? 但是我不清楚这是问题还是问题或者意味着什么。

此外,其他全局安装的npm模块运行正常

I've tried uninstalling and and reinstalling nodemon several times both locally and globally with:

npm install -g nodemon

(tried it both with and without sudo)

and it seems to install no problem, and gives me:

/usr/local/bin/bin/nodemon -> /usr/local/bin/lib/node_modules/nodemon/bin/nodemon.js /usr/local/bin/lib └── nodemon@1.11.0

but whenever I run

nodemon server.js

in my app, I get;

-bash: nodemon: command not found

Like I mentioned, I've tried the same process but installing locally to my app dependancies, but it doesn't seem to make a difference. What's going on here? I followed the same process on a different machine, and it worked no problem.

Googling around, I came across some posts that mentioned changing/adding the PATH? But it's not clear to me if that's or the problem or what that means.

Also, other globally installed npm modules run just fine

最满意答案

bash没有找到nodemon 。

编辑~/.bash_profile文件并添加:

PATH=$PATH:/usr/local/bin/bin/

启动一个新shell以查看它是否有效,或者运行source ~/.bash_profile以使其适用于当前会话。

nodemon is not being found by bash.

Edit your ~/.bash_profile file and add:

PATH=$PATH:/usr/local/bin/bin/

Start a new shell to see it work, or run source ~/.bash_profile to have it apply to the current session.

更多推荐

本文发布于:2023-08-03 02:51:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1382903.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:Nodemon   installed

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!