简体   繁体   中英

sh: nodemon: command not found

I changed the source of my zsh with source ~/.zshrc and all of my npm packages while using the npm run command in package.json have stopped working. I've tried to search for answers online and they say to add the bash source. I don't have bash installed and I don't know where the previous configuration file was located. I've added various lines to export in my zshrc file but it has not fixed my packages.

The error I'm receiving

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

This is my.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

I don't want to install nodemon globally with -g because this is happening to all of my packages. I can't install every last package globally, there's like 500 of them in the package.lock

I fixed it by removing my node_modules folder and doing an npm install again.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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