Help

Upcoming database upgrades. Airtable functionality will be reduced for ~15 minutes at 06:00 UTC on Feb. 4 / 10:00 pm PT on Feb. 3. Learn more here

Unable to install blocks-cli

Topic Labels: Custom Extensions
Solved
Jump to Solution
4700 19
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

1 Solution

Accepted Solutions

I got the same error on ubuntu 18.04 on WSL trying to install v0.0.53. v0.0.52 installs successfully.

@Sergey_Royz you can install 0.0.52 by:

npm install -g @airtable/blocks-cli@0.0.52

Cheers,
Ronen Babayoff
Superblocks.at

See Solution in Thread

19 Replies 19

I got the same error on ubuntu 18.04 on WSL trying to install v0.0.53. v0.0.52 installs successfully.

@Sergey_Royz you can install 0.0.52 by:

npm install -g @airtable/blocks-cli@0.0.52

Cheers,
Ronen Babayoff
Superblocks.at

There is a known issue with node-gyp & macOS Catalina the solution is to install “Command Line Tools for Xcode” manually from https://developer.apple.com/download/more

Hi, we just released a new version of blocks-cli (0.0.54) which shouldn’t have this problem.

Thanks for reporting this issue!

Hi,

I am trying for the first time to build an app using the exemple “Wikipedia enrichment”
When I try to Install the Blocks CLI (npm install -g @airtable/blocks-cli), I have this message :

Last login: Sat Dec 19 12:24:27 on ttys000

The default interactive shell is now zsh.

To update your account to use zsh, please run `chsh -s /bin/zsh`.

For more details, please visit https://support.apple.com/kb/HT208050.

MacBook-Pro-2:~ thibaud$ npm install -g @airtable/blocks-cli

npm WARN deprecated fsevents@2.1.3: Please update to v 2.2.x

npm WARN deprecated @hapi/joi@15.1.1: Switch to 'npm install joi'

npm WARN deprecated har-validator@5.1.5: this library is no longer supported

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 checkPermissions Missing write access to /usr/local/lib/node_modules

npm ERR! code EACCES

npm ERR! syscall access

npm ERR! path /usr/local/lib/node_modules

npm ERR! errno -13

npm ERR! Error: EACCES: permission denied, access '/usr/local/lib/node_modules'

npm ERR! [Error: EACCES: permission denied, access '/usr/local/lib/node_modules'] {

npm ERR! errno: -13,

npm ERR! code: 'EACCES',

npm ERR! syscall: 'access',

npm ERR! path: '/usr/local/lib/node_modules'

npm ERR! }

npm ERR!

npm ERR! The operation was rejected by your operating system.

npm ERR! It is likely you do not have the permissions to access this file as the current user

npm ERR!

npm ERR! If you believe this might be a permissions issue, please double-check the

npm ERR! permissions of the file and its containing directories, or try running

npm ERR! the command again as root/Administrator.

npm ERR! A complete log of this run can be found in:

npm ERR! /Users/thibaud/.npm/_logs/2020-12-19T11_31_32_994Z-debug.log

MacBook-Pro-2:~ thibaud$

Could anyone help me, I am not a developer :winking_face:
Mac OS Big Sur 11.1 (20C69)
node -v14.15.3
npm -v6.14.9

Thanks in advance !

Thibaud -

Hi @Thibaud_Donzier,

Hm, this looks like an npm issue with installing global package (not specific to the blocks-cli). It seems like your user account isn’t the owner of /usr/local/lib/node_modules (or at least can’t modify it).

Could you try either changing the owner of that directory to your account (see this similar stackoverflow issue for steps), or going through the steps listed on this npm help page to manually change the default npm directory?

I’m trying to install this for the first time on my Mac (running Catalina). I got past the node_modules permissions issue thanks to your suggestions above, but now I’ve hit a new error:

npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated @hapi/joi@15.1.1: Switch to 'npm install joi'
npm WARN deprecated @hapi/hoek@8.5.1: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/bourne@1.3.2: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/topo@3.1.6: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/address@2.1.4: Moved to 'npm install @sideway/address'
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
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 ERR! code EACCES
npm ERR! syscall symlink
npm ERR! path ../lib/node_modules/@airtable/blocks-cli/bin/block
npm ERR! dest /usr/local/bin/block
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, symlink '../lib/node_modules/@airtable/blocks-cli/bin/block' -> '/usr/local/bin/block'
npm ERR!  [OperationalError: EACCES: permission denied, symlink '../lib/node_modules/@airtable/blocks-cli/bin/block' -> '/usr/local/bin/block'] {
npm ERR!   cause: [Error: EACCES: permission denied, symlink '../lib/node_modules/@airtable/blocks-cli/bin/block' -> '/usr/local/bin/block'] {
npm ERR!     errno: -13,
npm ERR!     code: 'EACCES',
npm ERR!     syscall: 'symlink',
npm ERR!     path: '../lib/node_modules/@airtable/blocks-cli/bin/block',
npm ERR!     dest: '/usr/local/bin/block'
npm ERR!   },
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'symlink',
npm ERR!   path: '../lib/node_modules/@airtable/blocks-cli/bin/block',
npm ERR!   dest: '/usr/local/bin/block'
npm ERR! }
npm ERR! 
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR! 
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.

Thanks to @Kamille_Parks for suggesting that I run the command as sudo. The installation completed after that, but there’s still an error in the output. Is that something to worry about?

npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated @hapi/joi@15.1.1: Switch to 'npm install joi'
npm WARN deprecated @hapi/hoek@8.5.1: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/bourne@1.3.2: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated @hapi/address@2.1.4: Moved to 'npm install @sideway/address'
npm WARN deprecated @hapi/topo@3.1.6: This version has been deprecated and is no longer supported or maintained
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
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.
/usr/local/bin/block -> /usr/local/lib/node_modules/@airtable/blocks-cli/bin/block
> fsevents@1.2.13 install /usr/local/lib/node_modules/@airtable/blocks-cli/node_modules/watchify/node_modules/fsevents
> node install.js
gyp WARN EACCES current user ("nobody") does not have permission to access the dev dir "/Users/justinbarrett/Library/Caches/node-gyp/14.15.4"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/local/lib/node_modules/@airtable/blocks-cli/node_modules/watchify/node_modules/fsevents/.node-gyp"
gyp WARN install got an error, rolling back install
gyp WARN install got an error, rolling back install
gyp ERR! configure error 
gyp ERR! stack Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/@airtable/blocks-cli/node_modules/watchify/node_modules/fsevents/.node-gyp'
gyp ERR! System Darwin 19.6.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/local/lib/node_modules/@airtable/blocks-cli/node_modules/watchify/node_modules/fsevents
gyp ERR! node -v v14.15.4
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok 
> core-js@3.6.4 postinstall /usr/local/lib/node_modules/@airtable/blocks-cli/node_modules/core-js
> node -e "try{require('./postinstall')}catch(e){}"
Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!
The project needs your help! Please consider supporting of core-js on Open Collective or Patreon: 
> https://opencollective.com/core-js 
> https://www.patreon.com/zloirock 
Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)
+ @airtable/blocks-cli@0.0.61
added 894 packages from 518 contributors in 20.731s

Hey all,

The issue was with the dependencies with the NPM version.

  1. npm install 13
  2. npm use 13
  3. npm install -g @airtable/blocks-cli

You should be able to install now.

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

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:

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