Jun 28, 2020 01:38 PM
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.
Solved! Go to Solution.
Mar 25, 2021 12:29 PM
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.)
Mar 25, 2021 12:34 PM
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!
Mar 25, 2021 12:39 PM
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
Jun 27, 2021 08:03 PM
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.
Jun 28, 2021 12:59 PM
Hello,
This is not working for me. I’m using Node 14.15.0 (screenshot attached). Any ideas what I should be trying?
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:
Jun 28, 2021 01:37 PM
My current workaround is to use npx, which results in the cli working as expected:
npx @airtable/blocks-cli@0.0.64 run
Jun 30, 2021 08:25 AM
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...
Jul 05, 2021 07:28 AM
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:
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:
Dec 05, 2021 08:10 AM
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?
Dec 15, 2021 07:15 AM
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