1

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. I am following Airtable Hello World Tutorial. I attached screenshots to save you time. They instruct you to:

  1. Download their npm package with npm install -g @airtable/blocks-cli. Screenshot of instructions.

  2. Then run (x's and y's are for authorization.)

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

  2. Lastly block run

    enter image description here

This is where the issues start. I get an error that says zsh: command not found: block.

  • I have tried changing my $PATH variable a few different times
  • I added source ~/.bash_profile tp ,my ~/.zshrc
  • I tried adding an alias to my ~/.zshrc
  • I tried switching to bash and running the commands.
  • This (StackOverflow) seems to be the same issue but didn't work for me.

Relevant info

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

When I run echo $PATH I get:

/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:

/usr/local/bin/zsh

When I run which npm I get:

/usr/local/bin/npm

When I run npm list -g | head -n 1 I get:

/Users/{MY_NAME}/.npm-global/lib
WaterTrash
  • 428
  • 1
  • 6
  • 13
  • 1
    `zsh: command not found: block` should be read as "zsh is telling you that it cannot find command block". So where is the "block" command on your system? The PATH must be adjusted to the directory that contains `block`. I suspect `which block` returns nothing right now. – Nic3500 Sep 15 '20 at 00:40
  • Okay, that makes sense. The downloaded package is located at `/Users/{MY_NAME}/.npm-global/lib/node_modules/@airtable/blocks-cli`. I tried adding an alias in my `.zshrc` but wasnt sure what part of that directory to point the ailias to. The files are: `CHANGELOG.md, blocks_backend_wrapper package.json, README.md, keys, transpiled, bin, node_modules` – WaterTrash Sep 15 '20 at 16:35
  • And yes, `which block` returns nothing. – WaterTrash Sep 15 '20 at 17:19
  • You are trying to run `block run`, so there has to be a file called exactly `block` somewhere. That file has to be either an executable or a script that you can execute (`file block`). Find it, add it's directory location to your PATH and your are done. – Nic3500 Sep 16 '20 at 00:56

1 Answers1

0

I fixed this problem by using nvm to install node. 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

WaterTrash
  • 428
  • 1
  • 6
  • 13