commands not found on zsh

前端 未结 16 1662
梦毁少年i
梦毁少年i 2020-12-04 06:30

I am using the z Shell (zsh) instead of the default bash, and something wrong happen so that all commands who used to work are no longer recognized:

<         


        
16条回答
  •  天涯浪人
    2020-12-04 07:09

    if you are using macOS, try to follow this step

    if you write the code to export PATH in ~/.bash_profile then don't miss the Step 1

    Step 1:

    • make sure .bash_profile is loaded when your terminal is an open, check on your ~/.bashrc or ~/.zshrc (if you are using zsh), is there any code similar source ~/.bash_profile or not?. if not you can add manually with adding code source ~/.bash_profile in there
    • Also make sure this code is on your .bash_profile > export PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin if it not in there, add that code into it

    Sep 2:

    • make sure the "Visual Studio Code.app" is in the right place > "/Applications" or "/Users/$(whoami)/Applications"
    • remove the old installed vs-code PATH rm -rf /usr/local/bin/code
    • open "Visual Studio Code.app"
    • CMD+Shift+P and then select "Shell Command: Instal "code" command in PATH"
    • restart your Mac and check by run this code -v, it should be work

提交回复
热议问题