Help

Unable to install blocks-cli

Topic Labels: Custom Extensions
Solved
Jump to Solution
15429 19
cancel
Showing results for 
Search instead for 
Did you mean: 
Sergey_Royz
4 - Data Explorer
4 - Data Explorer

Hello,
I’m trying to create a new block,
but npm install -g @airtable/blocks-cli is not working
The error log:
ERR! stack at maybeClose (internal/child_process.js:1021:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
node-pre-gyp ERR!
System Darwin 19.3.0
node-pre-gyp ERR! command “/usr/local/bin/node” “/usr/local/lib/node_modules/@airtable/blocks-cli/node_modules/.bin/node-pre-gyp” “install” “–fallback-to-build”
node-pre-gyp ERR! cwd /usr/local/lib/node_modules/@airtable/blocks-cli/node_modules/nodegit
node-pre-gyp ERR! node -v v12.18.0
node-pre-gyp ERR! node-pre-gyp -v v0.13.0
node-pre-gyp ERR! not ok

Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/usr/local/lib/node_modules/@airtable/blocks-cli/node_modules/nodegit/build/Release/nodegit.node --module_name=nodegit --module_path=/usr/local/lib/node_modules/@airtable/blocks-cli/node_modules/nodegit/build/Release --napi_version=6 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v72' (1)
[nodegit] ERROR - Could not finish install
[nodegit] ERROR - finished with error code: 1
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! nodegit@0.26.5 install: `node lifecycleScripts/preinstall && node lifecycleScripts/install`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the nodegit@0.26.5 install script.

npm -v
6.14.4

node -v
v12.18.0

Mac OS X: 10.15.3

Any help appreciated.

19 Replies 19
Jonathan_Frank
5 - Automation Enthusiast
5 - Automation Enthusiast

I’m also having trouble installing blocks-cli but with a different error:

ENOENT: no such file or directory, chmod '/Users/dev/brew/lib/node_modules/@airtable/blocks-cli/node_modules/loose-envify/cli.js'

I’m on macOS 11.2.3, on an Apple M1 chip, node 15.2.0 and npm 7.0.10. Is this an NPM version issue and if so, how do I fix that? (The suggestion immediately above suggesting npm use 13 isn’t a valid npm command as far as I know.)

Hi @Jonathan_Frank,

Erin with Airtable Support here - sorry for the trouble!

This thread outlines the issue you are seeing, as well as the solution. You will need to downgrade your node version to v14.15.0, and that should resolve the issue!

@Jonathan_Frank

I believe that npm use 13 is a typo that was supposed to be nvm:

$ nvm install 14.15.0
$ nvm use 14.15
$ npm install -g @airtable/blocks-cli

I am using node 14.15 and still getting the same error.

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.

What’s weird is the file is there, and I have access.

Hello,

This is not working for me. I’m using Node 14.15.0 (screenshot attached). Any ideas what I should be trying?

Screen Shot 2021-06-28 at 3.58.41 PM

There’s no @airtable directory in /Users/eugene.kim/.nvm/versions/node/v14.15.0/lib/node_modules

Also notable is that I can’t install via yarn either:

Screen Shot 2021-06-28 at 4.09.46 PM

Eugene_Kim
6 - Interface Innovator
6 - Interface Innovator

My current workaround is to use npx, which results in the cli working as expected:

npx @airtable/blocks-cli@0.0.64 run

I had this same error and unstalling and reinstalling node v14.15.0 did it for me, thanks to guidance from Airtable.

Related npm github issue: [BUG] npm i -g fails with "This is related to npm not being able to find a file." · Issue #1458 · np...

If you take a look at Airtable’s GitHub repo, anything north of node 12.6 is wishful thinking at best and a sure-fire way to have a “hey, let’s spend the whole day googling obscure version control features” day at worst.

I’m sure you’re managing more projects than just your custom apps for Airtable, so my advice- just use nvm, learn its few commands, then never part with it again. By that time, we’ll probably get to use 2017 ECMAScript insice custom blocks haha.

EDIT: Just checked to see my current stack:

image

Airtable is the only reason why I have anything beyond the latest build and the latest LTS release of node installed. 95% of my issues with the SDK stopped when I started automatically downgrading my node version to 2009 prior to launching a block, come to think of it. :grinning_face_with_sweat:

You’re asking about the cli, specifically, but still, give it a try, it’s going to be node. :frog:

Danny_Eck
4 - Data Explorer
4 - Data Explorer

Dropping down node versions to 14.x worked for me with a global install @airtable/blocks-cli@0.x. A bummer for people like me experimenting with a custom app dev for a monorepo that uses some airtable stuff.

I imagine most developers expect an actively supported CLI to run on the active node LTS (gallium/16.x at the time I’m writing this). Can we assume the blocks-cli@2.x (beta dist tags) resolves? What is the current recommendation since an 0.x and a beta dist tag are roughly the same semver contract?

Also, would you prefer technical issues like this one be raised/tracked directly in github?

This is a simple fix, just add “sudo” to the front of the command:

sudo npm install -g @airtable/blocks-cli

You will be prompted to enter your password which is just what you use to log into your computer.

edit: JK I still have issues

edit 2:

The issue is that they don’t support node versions later than 14.

You can verify that you are on a later version by running this command in your terminal:

node -v

You’ll want to download a node management tool so you can easily switch between different versions:

wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash 

export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")" [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"

nvm install 14

nvm use 14

npm install -g @airtable/blocks-cli

Here’s a massive command that you can copy and paste to do everything in one shot:

wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash && export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" && nvm install 14 && nvm use 14 && npm install -g @airtable/blocks-cli && npx npm-check-updates -u && npm install && block --help