Skip to content

tfjs-node 1.6.0 does not work on macOS Catalina #2830

@mugglmenzel

Description

@mugglmenzel

TensorFlow.js version

1.6.0

Browser version

node: v13.6.0 (installed with homebrew)
node process.arch: x64

Describe the problem or feature request

Cannot install successfully on macOS Catalina!

Code to reproduce the bug / link to feature request

I am seeing the same error on Mac OS with version 1.6.0.

node: v13.6.0 (installed with homebrew)
node process.arch: x64
npm: 6.13.4
python: Python 2.7.16
OS: macOS Catalina, Version 10.15.3 (19D76)

Here is the output of npm install for the mnist-code example:


> @tensorflow/tfjs-node@1.6.0 install /Users/michaelmenzel/git/tfjs-examples/mnist-node/node_modules/@tensorflow/tfjs-node
> node scripts/install.js

CPU-darwin-1.6.0.tar.gz
* Downloading libtensorflow
[==============================] 14066559/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/1.6.0/CPU-darwin-1.6.0.tar.gz 
node-pre-gyp WARN Pre-built binaries not found for @tensorflow/tfjs-node@1.6.0 and node@13.6.0 (node-v79 ABI, unknown) (falling back to source compile with node-gyp) 
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 (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16)
gyp ERR! stack     at ChildProcess.emit (events.js:321:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
gyp ERR! System Darwin 19.3.0
gyp ERR! command "/usr/local/Cellar/node/13.6.0/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/Users/michaelmenzel/git/tfjs-examples/mnist-node/node_modules/@tensorflow/tfjs-node/lib/napi-v5/tfjs_binding.node" "--module_name=tfjs_binding" "--module_path=/Users/michaelmenzel/git/tfjs-examples/mnist-node/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/michaelmenzel/git/tfjs-examples/mnist-node/node_modules/@tensorflow/tfjs-node
gyp ERR! node -v v13.6.0
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/Cellar/node/13.6.0/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/Users/michaelmenzel/git/tfjs-examples/mnist-node/node_modules/@tensorflow/tfjs-node/lib/napi-v5/tfjs_binding.node --module_name=tfjs_binding --module_path=/Users/michaelmenzel/git/tfjs-examples/mnist-node/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/michaelmenzel/git/tfjs-examples/mnist-node/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:321:20)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:1028: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/Cellar/node/13.6.0/bin/node" "/Users/michaelmenzel/git/tfjs-examples/mnist-node/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /Users/michaelmenzel/git/tfjs-examples/mnist-node/node_modules/@tensorflow/tfjs-node
node-pre-gyp ERR! node -v v13.6.0
node-pre-gyp ERR! node-pre-gyp -v v0.14.0
node-pre-gyp ERR! not ok 

npm notice created a lockfile as package-lock.json. You should commit this file.
added 100 packages from 108 contributors and audited 186 packages in 12.349s

2 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

And the output of node main.js:

internal/modules/cjs/loader.js:976
  throw err;
  ^

Error: Cannot find module '/Users/michaelmenzel/git/tfjs-examples/mnist-node/node_modules/@tensorflow/tfjs-node/lib/napi-v5/tfjs_binding.node'
Require stack:
- /Users/michaelmenzel/git/tfjs-examples/mnist-node/node_modules/@tensorflow/tfjs-node/dist/index.js
- /Users/michaelmenzel/git/tfjs-examples/mnist-node/main.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:973:15)
    at Function.Module._load (internal/modules/cjs/loader.js:855:27)
    at Module.require (internal/modules/cjs/loader.js:1033:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object.<anonymous> (/Users/michaelmenzel/git/tfjs-examples/mnist-node/node_modules/@tensorflow/tfjs-node/dist/index.js:46:16)
    at Module._compile (internal/modules/cjs/loader.js:1144:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1164:10)
    at Module.load (internal/modules/cjs/loader.js:993:32)
    at Function.Module._load (internal/modules/cjs/loader.js:892:14)
    at Module.require (internal/modules/cjs/loader.js:1033:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/Users/michaelmenzel/git/tfjs-examples/mnist-node/node_modules/@tensorflow/tfjs-node/dist/index.js',
    '/Users/michaelmenzel/git/tfjs-examples/mnist-node/main.js'
  ]
}

If I run npm rebuild @tensorflow/tfjs-node --build-from-source I see the following output:


> @tensorflow/tfjs-node@1.6.0 install /Users/michaelmenzel/git/tfjs-examples/mnist-node/node_modules/@tensorflow/tfjs-node
> node scripts/install.js

CPU-darwin-1.6.0.tar.gz
* 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 
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 (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16)
gyp ERR! stack     at ChildProcess.emit (events.js:321:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
gyp ERR! System Darwin 19.3.0
gyp ERR! command "/usr/local/Cellar/node/13.6.0/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/Users/michaelmenzel/git/tfjs-examples/mnist-node/node_modules/@tensorflow/tfjs-node/lib/napi-v5/tfjs_binding.node" "--module_name=tfjs_binding" "--module_path=/Users/michaelmenzel/git/tfjs-examples/mnist-node/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/michaelmenzel/git/tfjs-examples/mnist-node/node_modules/@tensorflow/tfjs-node
gyp ERR! node -v v13.6.0
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/Cellar/node/13.6.0/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/Users/michaelmenzel/git/tfjs-examples/mnist-node/node_modules/@tensorflow/tfjs-node/lib/napi-v5/tfjs_binding.node --module_name=tfjs_binding --module_path=/Users/michaelmenzel/git/tfjs-examples/mnist-node/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/michaelmenzel/git/tfjs-examples/mnist-node/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:321:20)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:1028: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/Cellar/node/13.6.0/bin/node" "/Users/michaelmenzel/git/tfjs-examples/mnist-node/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /Users/michaelmenzel/git/tfjs-examples/mnist-node/node_modules/@tensorflow/tfjs-node
node-pre-gyp ERR! node -v v13.6.0
node-pre-gyp ERR! node-pre-gyp -v v0.14.0
node-pre-gyp ERR! not ok 

@tensorflow/tfjs-node@1.6.0 /Users/michaelmenzel/git/tfjs-examples/mnist-node/node_modules/@tensorflow/tfjs-node

XCode is installed. When I run xcode-select --install I get following response:

xcode-select: error: command line tools are already installed, use "Software Update" to install updates

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions