sh:nodemon:找不到命令

时间:2020-08-03 00:28:00

标签: node.js bash npm

我用source ~/.zshrc更改了zsh的源,并且在package.json中使用npm run命令时,我所有的npm软件包都停止了工作。我试图在线搜索答案,他们说要添加bash源。我没有安装bash,也不知道以前的配置文件在哪里。我在zshrc文件中添加了几行要导出的文件,但是它没有修复我的包。

我收到的错误

sh: nodemon: command not found
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file sh
npm ERR! errno ENOENT

这是我的.zsrch

export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
export PATH="/usr/lib/google-cloud-sdk/bin:$PATH"

# The next line updates PATH for the Google Cloud SDK.
if [ -f '/Users/admin/google-cloud-sdk/path.zsh.inc' ]; then . '/Users/admin/google-cloud-sdk/path.zsh.inc'; fi

# The next line enables shell command completion for gcloud.
if [ -f '/Users/admin/google-cloud-sdk/completion.zsh.inc' ]; then . '/Users/admin/google-cloud-sdk/completion.zsh.inc'; fi

export PATH=$PATH:/Users/admin/npm/bin
export PATH=$PATH:~/npm
export PATH=$HOME/.local/bin:$PATH
export PATH=/usr/local/share/npm/bin:$PATH

我不想用-g全局安装nodemon,因为这在我所有的软件包中都在发生。我无法在全球范围内安装每个最新的软件包,该软件包中大约有500个。

1 个答案:

答案 0 :(得分:0)

我通过删除node_modules文件夹并再次进行npm安装来修复它。