node-pre-gyp install failed with error: Error: Command failed: node-pre-gyp install --fallback-to-build
See original GitHub issuePlease make sure that this is a bug. As per our GitHub Policy, we only address code/doc bugs, performance issues, feature requests and build/installation issues on GitHub. tag:bug_template
System information
- Have I written custom code (as opposed to using a stock example script provided in TensorFlow.js):
NO
- OS Platform and Distribution (e.g., Linux Ubuntu 16.04):
ProductName: Mac OS X
ProductVersion: 10.14.5
BuildVersion: 18F132
- Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device:
Not applicable
- TensorFlow.js installed from (npm or script link):
Latest version from command
npm i @tensorflow/tfjs-node
- TensorFlow.js version (use command below):
- Browser version:
Not applicable
usingNode.JS
- Tensorflow.js Converter Version:
Not applicable
Describe the current behavior
Installation error after npm i @tensorflow/tfjs-node
> @tensorflow/tfjs-node@2.4.0 install /Users/loretoparisi/Documents/Projects/AI/tensorflow-node-examples/toxicity/node_modules/@tensorflow/tfjs-node
> node scripts/install.js
CPU-darwin-2.4.0.tar.gz
* Downloading libtensorflow
[==============================] 8801882/bps 100% 0.0s
* Building TensorFlow Node.js bindings
node-pre-gyp install failed with error: Error: Command failed: node-pre-gyp install --fallback-to-build
node-pre-gyp WARN Using needle for node-pre-gyp https download
node-pre-gyp WARN Tried to download(404): https://storage.googleapis.com/tf-builds/pre-built-binary/napi-v5/2.4.0/CPU-darwin-2.4.0.tar.gz
node-pre-gyp WARN Pre-built binaries not found for @tensorflow/tfjs-node@2.4.0 and node@12.16.1 (node-v72 ABI, unknown) (falling back to source compile with node-gyp)
Traceback (most recent call last):
File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py", line 50, in <module>
sys.exit(gyp.script_main())
File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 554, in script_main
return main(sys.argv[1:])
File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 547, in main
return gyp_main(args)
File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 532, in gyp_main
generator.GenerateOutput(flat_list, targets, data, params)
File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py", line 2215, in GenerateOutput
part_of_all=qualified_target in needed_targets)
File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py", line 845, in Write
mac_bundle_deps, extra_outputs, part_of_all)
File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py", line 1539, in WriteTarget
self.WriteSortedXcodeEnv(self.output, self.GetSortedXcodePostbuildEnv())
File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py", line 1896, in GetSortedXcodePostbuildEnv
additional_settings={'CHROMIUM_STRIP_SAVE_FILE': strip_save_file})
File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py", line 1885, in GetSortedXcodeEnv
additional_settings)
File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py", line 1616, in GetSortedXcodeEnv
additional_settings)
File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py", line 1527, in _GetXcodeEnv
if XcodeVersion() >= '0500' and not env.get('SDKROOT'):
TypeError: '>=' not supported between instances of 'tuple' and 'str'
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16)
gyp ERR! stack at ChildProcess.emit (events.js:311:20)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
gyp ERR! System Darwin 18.6.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/Users/loretoparisi/Documents/Projects/AI/tensorflow-node-examples/toxicity/node_modules/@tensorflow/tfjs-node/lib/napi-v5/tfjs_binding.node" "--module_name=tfjs_binding" "--module_path=/Users/loretoparisi/Documents/Projects/AI/tensorflow-node-examples/toxicity/node_modules/@tensorflow/tfjs-node/lib/napi-v5" "--napi_version=5" "--node_abi_napi=napi" "--napi_build_version=5" "--node_napi_label=napi-v5"
gyp ERR! cwd /Users/loretoparisi/Documents/Projects/AI/tensorflow-node-examples/toxicity/node_modules/@tensorflow/tfjs-node
gyp ERR! node -v v12.16.1
gyp ERR! node-gyp -v v5.0.5
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: 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=/Users/loretoparisi/Documents/Projects/AI/tensorflow-node-examples/toxicity/node_modules/@tensorflow/tfjs-node/lib/napi-v5/tfjs_binding.node --module_name=tfjs_binding --module_path=/Users/loretoparisi/Documents/Projects/AI/tensorflow-node-examples/toxicity/node_modules/@tensorflow/tfjs-node/lib/napi-v5 --napi_version=5 --node_abi_napi=napi --napi_build_version=5 --node_napi_label=napi-v5' (1)
node-pre-gyp ERR! stack at ChildProcess.<anonymous> (/Users/loretoparisi/Documents/Projects/AI/tensorflow-node-examples/toxicity/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:311:20)
node-pre-gyp 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 18.6.0
node-pre-gyp ERR! command "/usr/local/bin/node" "/Users/loretoparisi/Documents/Projects/AI/tensorflow-node-examples/toxicity/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /Users/loretoparisi/Documents/Projects/AI/tensorflow-node-examples/toxicity/node_modules/@tensorflow/tfjs-node
node-pre-gyp ERR! node -v v12.16.1
node-pre-gyp ERR! node-pre-gyp -v v0.14.0
node-pre-gyp ERR! not ok
Describe the expected behavior
the command npm i @tensorflow/tfjs-node
should succeed.
Standalone code to reproduce the issue Provide a reproducible test case that is the bare minimum necessary to generate the problem. If possible, please share a link to Colab/CodePen/any notebook.
I have used to following install command in a clean folder
npm i @tensorflow/tfjs-node
Other info / logs Include any logs or source code that would be helpful to
diagnose the problem. If including tracebacks, please include the full
traceback. Large logs and files should be attached.
Not applicable
- log reported above
Issue Analytics
- State:
- Created 3 years ago
- Comments:6
Top GitHub Comments
To fix the issue (worked for me on Ubuntu 18)
The other approach I have used was to reinstall
npm
doingsudo npm install npm@latest -g
so I haveand now it works! 💯
The problem now becomes th 2nd one, I have cited here
Closing this specific one then.