Help

Code ENOENT when installing Airtable Blocks

Topic Labels: Custom Extensions
1338 2
cancel
Showing results for 
Search instead for 
Did you mean: 
Anubhav_Ghosh
4 - Data Explorer
4 - Data Explorer

Hey!

I am trying to install Airtable block but I end up have these errors:

npm ERR! code ENOENT
npm ERR! syscall chmod
npm ERR! path /opt/homebrew/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 '/opt/homebrew/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 

I am using 14.7.6 node on a Macbook M1 with Big Sur. I have tried out the other solutions here but nothing worked for me! Can anyone help me out?

2 Replies 2
chexton
4 - Data Explorer
4 - Data Explorer

@Anubhav_Ghosh did you manage to resolve this? I am having the same error: have tried in both an M1 terminal and a terminal running under Rosetta to no avail!

Nicholas_Reilin
4 - Data Explorer
4 - Data Explorer

Same issue here. I’m on Intel, Big Sur, node 16.9.1. I believe I also installed node via homebrew. /usr/local/lib/node_modules (the equivalent path to yours on Intel) is owned by my username and group admin, and has mode 755. When I inspect that directory, there is no @airtable subdirectory. I may also be using the asdf version manager, but I don’t remember exactly how I configured it and this issue seems widely-reported enough that I don’t think I need to care.

What I ended up doing to workaround the issue is invoke the command directly with npx:

$ npx @airtable/blocks-cli init appblahblahblah/blkblahblahblah --template=https://github.com/example project_name – basically replacing block init in the guide with npx @airtable/blocks-cli init.

After the new project is created and you’ve cd'd to it, you can then install the package locally as a dev dependency with npm install -D @airtable/blocks-cli. (Frankly, my opinion is that npm -g is an antipattern, so I don’t mind this.)

Then, from within the project directory, you can prefix any block command with npx to have NPM run the command directly from the installed dev dependency. So instead of block run, you just do npx block run.

Note that we couldn’t do npx block init in the first step because npx has no idea what block means until we install the package to the project – so instead we bootstrap by using the full name of @airtable/blocks-cli.

Hope this helps. Also hope Airtable fixes their broken package.