简体   繁体   中英

Zsh : command not found : ng on new Mac OS Catalina

I have download the new Mac OS Version Beta of Catalina. Now I should start to use Zsh. But when I want to run a Angular project in Atom, I receveid this message : "The default interactive shell is now zsh. To update your account to use zsh, please run chsh -s /bin/zsh . For more details, please visit https://support.apple.com/kb/HT208050 ." I'am already using zsh Terminal but he doesn't found the ng commands.

I also lost access to my commands after moving over to zsh following the Catalina upgrade. This fixed it for me: source /Users/YOURUSERNAME/.bash_profile

In order to get these changes to persist, I used oh-my-zsh ( https://github.com/robbyrussell/oh-my-zsh ).

Install with curl: sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

Then modify your .zshrc file: vi ~/.zshrc

Underneath this line: source $ZSH/oh-my-zsh.sh

I simply added the command I mentioned at the start of the post:

source /Users/YOURUSERNAME/.bash_profile

Save the file as you normally would with vi/vim: :wq

Oh-my-zsh is also capable of a lot of cool things so be sure to read the documentation.

The angular-cli has to be installed on your machine.

install the cli by running the command : npm install -g @angular/cli

If you had previously gone through the steps by sindresorhus to "Install npm packages globally without sudo" for bash, do them again for zsh. https://github.com/sindresorhus/guides/blob/master/npm-global-without-sudo.md

check with node version you're on. Download here - https://github.com/nvm-sh/nvm

For me I encountered same problem with version 8.

nvm ls

it should list node version - using version 13 of node - worked for me.

 nvm install 13
 npm install -g @angular/cli

should work now.

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