简体   繁体   English

未找到 ZSH 命令

[英]ZSH command not found

I realize this question has been asked a ton, but I feel like I've tried everything.我意识到这个问题已经被问到了很多,但我觉得我已经尝试了一切。 I haven't had any issues with node or npm for months up until now.直到现在,我几个月来都没有遇到 node 或 npm 的任何问题。 I am following Airtable Hello World Tutorial .我正在关注Airtable Hello World 教程 I attached screenshots to save you time.我附上了屏幕截图以节省您的时间。 They instruct you to:他们指示您:

  1. Download their npm package with npm install -g @airtable/blocks-cli .使用npm install -g @airtable/blocks-cli下载他们的 npm 包。 说明截图。

  2. Then run (x's and y's are for authorization.)然后运行(x 和 y 用于授权。)

block init xxxxxxxxx/yyyyyyyyyyyyy --template=https://github.com/Airtable/blocks-hello-world hello_world
  1. Followed by cd hello_world其次是cd hello_world

  2. Lastly block run最后block run

    在此处输入图片说明

This is where the issues start.这就是问题开始的地方。 I get an error that says zsh: command not found: block .我收到一条错误消息,指出zsh: command not found: block

  • I have tried changing my $PATH variable a few different times我试过多次更改我的 $PATH 变量
  • I added source ~/.bash_profile tp ,my ~/.zshrc我添加了source ~/.bash_profile tp ,我的~/.zshrc
  • I tried adding an alias to my ~/.zshrc我尝试向我的~/.zshrc添加别名
  • I tried switching to bash and running the commands.我尝试切换到 bash 并运行命令。
  • This (StackOverflow) seems to be the same issue but didn't work for me.(StackOverflow)似乎是同样的问题,但对我不起作用。

Relevant info相关信息

npm@6.13.4 /usr/local/lib/node_modules/npm

When I run echo $PATH I get:当我运行echo $PATH我得到:

/Library/Frameworks/Python.framework/Versions/3.8/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/{MY_NAME}/npm/bin

When I run which zsh I get:当我运行which zsh我得到:

/usr/local/bin/zsh

When I run which npm I get:当我运行which npm我得到:

/usr/local/bin/npm

When I run npm list -g | head -n 1当我运行npm list -g | head -n 1 npm list -g | head -n 1 I get: npm list -g | head -n 1我得到:

/Users/{MY_NAME}/.npm-global/lib

I fixed this problem by using nvm to install node.我通过使用 nvm 安装节点解决了这个问题。 It's much easier to use and I haven't run into these issues anymore.它更容易使用,而且我不再遇到这些问题。

Here is the link: https://github.com/nvm-sh/nvm这是链接: https : //github.com/nvm-sh/nvm

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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