Help

Re: Hello World Errors with Blocks-CLI

Solved
Jump to Solution
2830 6
cancel
Showing results for 
Search instead for 
Did you mean: 
ktyacke
5 - Automation Enthusiast
5 - Automation Enthusiast

Hello Community,
Trying to create my first Airtable App by following the Hello World example and running into a number of npm errors and issues. If anyone can provide a bit of guidance on how to resolve this it would be greatly appreciated!

The first error occurs when trying to run

Airtable npm install -g @airtable/blocks-cli
npm WARN deprecated urix@0.1.0: P
npm WARN deprecated resolve-url@0.2.1:
npm WARN deprecated fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm WARN deprecated chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm WARN deprecated chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm ERR! code ENOENT
npm ERR! syscall chmod
npm ERR! path /usr/local/lib/node_modules/@airtable/blocks-cli/node_modules/loose-envify/cli.js
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, chmod ‘/usr/local/lib/node_modules/@airtable/blocks-cli/node_modules/loose-envify/cli.js’
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

If I try to push past this and run
➜ Airtable block init app63J6OIpQdSMMn9/blk1y83B9jm8NXhd2 --template=https://github.com/Airtable/apps-hello-world hello_apps

I received another error “Cannot find module ‘extend’ Require stack…” Unfortunately, I’m unable to paste the full output of the require stack line as the community site limits the number of links I’m allowed to post and won’t allow me to submit my question with the additional information inline.

1 Solution

Accepted Solutions
somehats
6 - Interface Innovator
6 - Interface Innovator

Thanks! Unfortunately, the blocks CLI doesn’t support node version 15 yet. You could try downgrading your node version, or using a node version management tool like nodeenv or nvm to make it easier to switch between different node versions for different projects. Apologies for the inconvenience!

See Solution in Thread

7 Replies 7
somehats
6 - Interface Innovator
6 - Interface Innovator

Hi Kyle, sorry you’re running into this! Could you let us know your operating system & the version of node and npm you’re using? You can find out your node/npm versions by running node --version and npm --version.

ktyacke
5 - Automation Enthusiast
5 - Automation Enthusiast

Hey @somehats thanks for the response! Info below:

macOS Catalina 10.15.7
NPM: 7.0.3
Node: v15.0.1

Please let me know if there is other info I can share.

somehats
6 - Interface Innovator
6 - Interface Innovator

Thanks! Unfortunately, the blocks CLI doesn’t support node version 15 yet. You could try downgrading your node version, or using a node version management tool like nodeenv or nvm to make it easier to switch between different node versions for different projects. Apologies for the inconvenience!

ktyacke
5 - Automation Enthusiast
5 - Automation Enthusiast

No inconvenience at all. If there is a way to update the SDK to output something to check the version and output a message notifying this requirement, you might help other users who run into this =]

Thanks for the help!

ktyacke
5 - Automation Enthusiast
5 - Automation Enthusiast

@somehats A follow-up question for you on this topic. Using NVM I installed Node version 14.15.0 and reinstalled the blocks-cli with success. However, when I tried to run block init, I ran into similar issues with “Cannot find module ‘extend’”.

➜ ~ block init / --template=https://github.com/Airtable/apps-hello-world hello_apps

:x: Error: Cannot find module ‘extend’
Require stack:

  • /usr/local/lib/node_modules/@airtable/blocks-cli/node_modules/postman-request/index.js
  • /usr/local/lib/node_modules/@airtable/blocks-cli/transpiled/src/helpers/init_command_helpers.js
    … (Cut additional output due to restrictions on how many “links” I can paste as a new user)

Is Node version 14.15.0 supported, or is there something else perhaps that I am missing?

Heh, that (or even better just fixing the issue) is definitely the plan :grinning_face_with_sweat:

It looks like your system might still be using the old version of the block command that didn’t install properly from before… can you try removing the previously installed version? You might need to switch back to a non-nvm version of node before running npm uninstall @airtable/blocks-cli? Another easier but maybe riskier approach might be to rm -rf /usr/local/lib/node_modules/@airtable/blocks-cli

ktyacke
5 - Automation Enthusiast
5 - Automation Enthusiast

That did the trick, thank you @somehats!

And for anyone else who’s running into this issue: There’s a nice NVM start tutorial at https://itnext.io/nvm-the-easiest-way-to-switch-node-js-environments-on-your-machine-in-a-flash-17ba... Make sure to run the command source ~/.nvm/nvm.sh after you install NVM to make sure it is fully installed and loaded. From there, just follow the instructions to load Node version 14.15.0, then follow @somehats instructions above to uninstall CLI-Blocks if needed, and finally run through the installation procedure again, and you should be golden.