Volto: iltorb Command failed and gyp build failing when running yarn install (on MacOS Catalina)

Running yarn install on MacOS Catalina results in the error below:

error ... s/iltorb: Command failed.
Exit code: 1
Command: node ./scripts/install.js || node-gyp rebuild
Arguments: 
Directory: .../node_modules/iltorb
Output:
info looking for cached prebuild @ .../.npm/_prebuilds/82ff49-iltorb-v2.4.5-node-v83-darwin-x64.tar.gz
http request GET https://github.com/nstepien/iltorb/releases/download/v2.4.5/iltorb-v2.4.5-node-v83-darwin-x64.tar.gz
http 404 https://github.com/nstepien/iltorb/releases/download/v2.4.5/iltorb-v2.4.5-node-v83-darwin-x64.tar.gz
WARN install No prebuilt binaries found (target=14.15.1 runtime=node arch=x64 libc= platform=darwin)
gyp info it worked if it ends with ok
gyp info using node-gyp@5.1.0
gyp info using node@14.15.1 | darwin | x64
gyp info find Python using Python version 2.7.16 found at "/System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python"
gyp info spawn /System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python
gyp info spawn args [
gyp info spawn args   '/.../.nvm/versions/node/v14.15.1/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'make',
gyp info spawn args   '-I',
gyp info spawn args   '/.../.../node_modules/iltorb/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/.../.nvm/versions/node/v14.15.1/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/.../Library/Caches/node-gyp/14.15.1/include/node/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/.../Library/Caches/node-gyp/14.15.1',
gyp info spawn args   '-Dnode_gyp_dir=/.../.nvm/versions/node/v14.15.1/lib/node_modules/npm/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/.../Library/Caches/node-gyp/14.15.1/<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/.../Documents/code/invoice-review/node_modules/iltorb',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'build',
gyp info spawn args   '-Goutput_dir=.'
gyp info spawn args ]
No receipt for 'com.apple.pkg.CLTools_Executables' found at '/'.

No receipt for 'com.apple.pkg.DeveloperToolsCLILeo' found at '/'.

No receipt for 'com.apple.pkg.DeveloperToolsCLI' found at '/'.

gyp: No Xcode or CLT version detected!
gyp ERR! configure error 
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (.../.nvm/versions/node/v14.15.1/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16)
gyp ERR! stack     at ChildProcess.emit (events.js:315:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)
gyp ERR! System Darwin 19.6.0
gyp ERR! command ".../.nvm/versions/node/v14.15.1/bin/node" ".../.nvm/versions/node/v14.15.1/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd .../.../node_modules/iltorb

According to node-gyp rebuild fails in macOS Catalina (10.15) - No rule to make target `node_modules/node-gyp/addon.gypi`, needed by `Makefile'. · Issue #1779 · nodejs/node-gyp · GitHub

The solution is to run the following command:

xcode-select -s /Applications/Xcode.app/Contents/Developer

Doing that, before running yarn install did indeed resolve the issue for me.

4 Likes

Apple breaks that every single time you do an upgrade, I even have an alias:

alias fixxcode="sudo rm -rf /Library/Developer/CommandLineTools && sudo xcode-select --reset && xcode-select --install"

(I usually never install XCode, this is for a CommandlineTools only install)

1 Like

Maybe we can get rid of that dependency... Update bundlesize to get rid of iltorb · Issue #2606 · plone/volto · GitHub