我尝试在本地和全局多次卸载和重新安装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.0but whenever I run
nodemon server.jsin my app, I get;
-bash: nodemon: command not foundLike 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.
更多推荐
发布评论