learn-tfjs
learn-tfjs copied to clipboard
404 Not Found on https://storage.googleapis.com/tf-builds/pre-built-binary/napi-v8/3.21.1/CPU-darwin-3.21.1.tar.gz
When trying to install node dependencies, specifically concerning tfjs-node
, there seems to be an issue. This may be specific to my system, as I'm running Apple silicon, but essentially what happens is when the install script attempts to download the pre built binaries from https://storage.googleapis.com/tf-builds/pre-built-binary/napi-v8/3.21.1/CPU-darwin-3.21.1.tar.gz it gets the following error:
node-pre-gyp ERR! install response status 404 Not Found on https://storage.googleapis.com/tf-builds/pre-built-binary/napi-v8/3.21.1/CPU-darwin-3.21.1.tar.gz
this eventually results in more errors as the build script attempts to build tensorflow.
what's strange is this file doesn't even exist in the directory @ https://storage.googleapis.com/tf-builds, and and there are zero darwin specific builds in for napi-v8
(the latest is napi-v7/3.6.1
for both CPU and GPU), so i'm unsure why the script is using the build above.
i'm wondering if i should be using a specific arm64 build of node for Apple Silicon or if tfjs-node
is even compilable natively on Apple silicon currently?
also happy to provide my full logs if it helps troubleshoot this issue.
Good issue. I'm not sure when we'll get around to looking at it, but that's a good data point. Please provide logs.
full logs below:
yarn
yarn install v1.22.19
warning ../../../../../../../package.json: No license field
warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
[1/4] 🔍 Resolving packages...
[2/4] 🚚 Fetching packages...
[3/4] 🔗 Linking dependencies...
warning "@tensorflow/tfjs-node > @tensorflow/tfjs > @tensorflow/[email protected]" has unmet peer dependency "seedrandom@^3.0.5".
[4/4] 🔨 Building fresh packages...
[3/3] ⠄ @tensorflow/tfjs-node
[2/3] ⠄ nodemon
error /Users/genericusername/Desktop/WORKING FILES/repos/learn-tfjs/chapter2/node/node-example/node_modules/@tensorflow/tfjs-node: Command failed.
Exit code: 1
Command: node scripts/install.js
Arguments:
Directory: /Users/genericusername/Desktop/WORKING FILES/repos/learn-tfjs/chapter2/node/node-example/node_modules/@tensorflow/tfjs-node
Output:
CPU-darwin-3.21.1.tar.gz
* Downloading libtensorflow
https://storage.googleapis.com/tf-builds/libtensorflow_r2_7_darwin_arm64_cpu.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 info it worked if it ends with ok
node-pre-gyp info using [email protected]
node-pre-gyp info using [email protected] | darwin | arm64
node-pre-gyp info check checked for "/Users/genericusername/Desktop/WORKING FILES/repos/learn-tfjs/chapter2/node/node-example/node_modules/@tensorflow/tfjs-node/lib/napi-v8/tfjs_binding.node" (not found)
node-pre-gyp http GET https://storage.googleapis.com/tf-builds/pre-built-binary/napi-v8/3.21.1/CPU-darwin-3.21.1.tar.gz
node-pre-gyp ERR! install response status 404 Not Found on https://storage.googleapis.com/tf-builds/pre-built-binary/napi-v8/3.21.1/CPU-darwin-3.21.1.tar.gz
node-pre-gyp WARN Pre-built binaries not installable for @tensorflow/[email protected] and [email protected] (node-v115 ABI, unknown) (falling back to source compile with node-gyp)
node-pre-gyp WARN Hit error response status 404 Not Found on https://storage.googleapis.com/tf-builds/pre-built-binary/napi-v8/3.21.1/CPU-darwin-3.21.1.tar.gz
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | darwin | arm64
gyp info ok
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | darwin | arm64
gyp info find Python using Python version 3.10.9 found at "/Users/genericusername/anaconda3/bin/python3"
gyp info spawn /Users/genericusername/anaconda3/bin/python3
gyp info spawn args [
gyp info spawn args '/Users/genericusername/.nvm/versions/node/v20.3.0/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 '/Users/genericusername/Desktop/WORKING FILES/repos/learn-tfjs/chapter2/node/node-example/node_modules/@tensorflow/tfjs-node/build/config.gypi',
gyp info spawn args '-I',
gyp info spawn args '/Users/genericusername/.nvm/versions/node/v20.3.0/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
gyp info spawn args '-I',
gyp info spawn args '/Users/genericusername/Library/Caches/node-gyp/20.3.0/include/node/common.gypi',
gyp info spawn args '-Dlibrary=shared_library',
gyp info spawn args '-Dvisibility=default',
gyp info spawn args '-Dnode_root_dir=/Users/genericusername/Library/Caches/node-gyp/20.3.0',
gyp info spawn args '-Dnode_gyp_dir=/Users/genericusername/.nvm/versions/node/v20.3.0/lib/node_modules/npm/node_modules/node-gyp',
gyp info spawn args '-Dnode_lib_file=/Users/genericusername/Library/Caches/node-gyp/20.3.0/<(target_arch)/node.lib',
gyp info spawn args '-Dmodule_root_dir=/Users/genericusername/Desktop/WORKING FILES/repos/learn-tfjs/chapter2/node/node-example/node_modules/@tensorflow/tfjs-node',
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 ]
gyp info ok
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | darwin | arm64
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
clang: error: no such file or directory: 'FILES/repos/learn-tfjs/chapter2/node/node-example/node_modules/@tensorflow/tfjs-node/deps/include'
make: *** [Release/obj.target/tfjs_binding/binding/tfjs_backend.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/Users/genericusername/.nvm/versions/node/v20.3.0/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:203:23)
gyp ERR! stack at ChildProcess.emit (node:events:511:28)
gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:293:12)
gyp ERR! System Darwin 22.5.0
gyp ERR! command "/Users/genericusername/.nvm/versions/node/v20.3.0/bin/node" "/Users/genericusername/.nvm/versions/node/v20.3.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/Users/genericusername/Desktop/WORKING FILES/repos/learn-tfjs/chapter2/node/node-example/node_modules/@tensorflow/tfjs-node/lib/napi-v8/tfjs_binding.node" "--module_name=tfjs_binding" "--module_path=/Users/genericusername/Desktop/WORKING FILES/repos/learn-tfjs/chapter2/node/node-example/node_modules/@tensorflow/tfjs-node/lib/napi-v8" "--napi_version=9" "--node_abi_napi=napi" "--napi_build_version=8" "--node_napi_label=napi-v8"
gyp ERR! cwd /Users/genericusername/Desktop/WORKING FILES/repos/learn-tfjs/chapter2/node/node-example/node_modules/@tensorflow/tfjs-node
gyp ERR! node -v v20.3.0
gyp ERR! node-gyp -v v9.3.1
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute '/Users/genericusername/.nvm/versions/node/v20.3.0/bin/node /Users/genericusername/.nvm/versions/node/v20.3.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/Users/genericusername/Desktop/WORKING FILES/repos/learn-tfjs/chapter2/node/node-example/node_modules/@tensorflow/tfjs-node/lib/napi-v8/tfjs_binding.node --module_name=tfjs_binding --module_path=/Users/genericusername/Desktop/WORKING FILES/repos/learn-tfjs/chapter2/node/node-example/node_modules/@tensorflow/tfjs-node/lib/napi-v8 --napi_version=9 --node_abi_napi=napi --napi_build_version=8 --node_napi_label=napi-v8' (1)
node-pre-gyp ERR! stack at ChildProcess.<anonymous> (/Users/genericusername/Desktop/WORKING FILES/repos/learn-tfjs/chapter2/node/node-example/node_modules/@mapbox/node-pre-gyp/lib/util/compile.js:89:23)
node-pre-gyp ERR! stack at ChildProcess.emit (node:events:511:28)
node-pre-gyp ERR! stack at maybeClose (node:internal/child_process:1098:16)
node-pre-gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:304:5)
node-pre-gyp ERR! System Darwin 22.5.0
node-pre-gyp ERR! command "/Users/genericusername/.nvm/versions/node/v20.3.0/bin/node" "/Users/genericusername/Desktop/WORKING FILES/repos/learn-tfjs/chapter2/node/node-example/node_modules/@tensorflow/tfjs-node/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /Users/genericusername/Desktop/WORKING FILES/repos/learn-tfjs/chapter2/node/node-example/node_modules/@tensorflow/tfjs-node
node-pre-gyp ERR! node -v v20.3.0
node-pre-gyp ERR! node-pre-gyp -v v1.0.9
I have the same problem on my MacBook with M1 chip:
`yarn add @tensorflow/tfjs-node yarn add v1.22.19 info No lockfile found. [1/4] 🔍 Resolving packages... [2/4] 🚚 Fetching packages... [3/4] 🔗 Linking dependencies... warning "@tensorflow/tfjs-node > @tensorflow/tfjs > @tensorflow/[email protected]" has unmet peer dependency "seedrandom@^3.0.5". [4/4] 🔨 Building fresh packages... [2/2] ⠂ @tensorflow/tfjs-node error /Users/egor/projects/ML/Simple TF/node_modules/@tensorflow/tfjs-node: Command failed. Exit code: 1 Command: node scripts/install.js Arguments: Directory: /Users/egor/projects/ML/Simple TF/node_modules/@tensorflow/tfjs-node Output: CPU-darwin-4.9.0.tar.gz
-
Downloading libtensorflow https://storage.googleapis.com/tf-builds/libtensorflow_r2_7_darwin_arm64_cpu.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 info it worked if it ends with ok node-pre-gyp info using [email protected] node-pre-gyp info using [email protected] | darwin | arm64 node-pre-gyp info check checked for "/Users/egor/projects/ML/Simple TF/node_modules/@tensorflow/tfjs-node/lib/napi-v8/tfjs_binding.node" (not found) node-pre-gyp http GET https://storage.googleapis.com/tf-builds/pre-built-binary/napi-v8/4.9.0/CPU-darwin-4.9.0.tar.gz node-pre-gyp ERR! install response status 404 Not Found on https://storage.googleapis.com/tf-builds/pre-built-binary/napi-v8/4.9.0/CPU-darwin-4.9.0.tar.gz node-pre-gyp WARN Pre-built binaries not installable for @tensorflow/[email protected] and [email protected] (node-v108 ABI, unknown) (falling back to source compile with node-gyp) node-pre-gyp WARN Hit error response status 404 Not Found on https://storage.googleapis.com/tf-builds/pre-built-binary/napi-v8/4.9.0/CPU-darwin-4.9.0.tar.gz gyp info it worked if it ends with ok gyp info using [email protected] gyp info using [email protected] | darwin | arm64 gyp info ok gyp info it worked if it ends with ok gyp info using [email protected] gyp info using [email protected] | darwin | arm64 gyp info find Python using Python version 3.11.3 found at "/Library/Frameworks/Python.framework/Versions/3.11/bin/python3" gyp info spawn /Library/Frameworks/Python.framework/Versions/3.11/bin/python3 gyp info spawn args [ gyp info spawn args '/Users/egor/.nvm/versions/node/v18.17.0/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 '/Users/egor/projects/ML/Simple TF/node_modules/@tensorflow/tfjs-node/build/config.gypi', gyp info spawn args '-I', gyp info spawn args '/Users/egor/.nvm/versions/node/v18.17.0/lib/node_modules/npm/node_modules/node-gyp/addon.gypi', gyp info spawn args '-I', gyp info spawn args '/Users/egor/Library/Caches/node-gyp/18.17.0/include/node/common.gypi', gyp info spawn args '-Dlibrary=shared_library', gyp info spawn args '-Dvisibility=default', gyp info spawn args '-Dnode_root_dir=/Users/egor/Library/Caches/node-gyp/18.17.0', gyp info spawn args '-Dnode_gyp_dir=/Users/egor/.nvm/versions/node/v18.17.0/lib/node_modules/npm/node_modules/node-gyp', gyp info spawn args '-Dnode_lib_file=/Users/egor/Library/Caches/node-gyp/18.17.0/<(target_arch)/node.lib', gyp info spawn args '-Dmodule_root_dir=/Users/egor/projects/ML/Simple TF/node_modules/@tensorflow/tfjs-node', 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 ] gyp info ok gyp info it worked if it ends with ok gyp info using [email protected] gyp info using [email protected] | darwin | arm64 gyp info spawn make gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ] clang: error: no such file or directory: 'TF/node_modules/@tensorflow/tfjs-node/deps/include' make: *** [Release/obj.target/tfjs_binding/binding/tfjs_backend.o] Error 1 gyp ERR! build error gyp ERR! stack Error:
make
failed with exit code: 2 gyp ERR! stack at ChildProcess.onExit (/Users/egor/.nvm/versions/node/v18.17.0/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:203:23) gyp ERR! stack at ChildProcess.emit (node:events:514:28) gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:291:12) gyp ERR! System Darwin 22.5.0 gyp ERR! command "/Users/egor/.nvm/versions/node/v18.17.0/bin/node" "/Users/egor/.nvm/versions/node/v18.17.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/Users/egor/projects/ML/Simple TF/node_modules/@tensorflow/tfjs-node/lib/napi-v8/tfjs_binding.node" "--module_name=tfjs_binding" "--module_path=/Users/egor/projects/ML/Simple TF/node_modules/@tensorflow/tfjs-node/lib/napi-v8" "--napi_version=9" "--node_abi_napi=napi" "--napi_build_version=8" "--node_napi_label=napi-v8" gyp ERR! cwd /Users/egor/projects/ML/Simple TF/node_modules/@tensorflow/tfjs-node gyp ERR! node -v v18.17.0 gyp ERR! node-gyp -v v9.3.1 gyp ERR! not ok node-pre-gyp ERR! build error node-pre-gyp ERR! stack Error: Failed to execute '/Users/egor/.nvm/versions/node/v18.17.0/bin/node /Users/egor/.nvm/versions/node/v18.17.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/Users/egor/projects/ML/Simple TF/node_modules/@tensorflow/tfjs-node/lib/napi-v8/tfjs_binding.node --module_name=tfjs_binding --module_path=/Users/egor/projects/ML/Simple TF/node_modules/@tensorflow/tfjs-node/lib/napi-v8 --napi_version=9 --node_abi_napi=napi --napi_build_version=8 --node_napi_label=napi-v8' (1) node-pre-gyp ERR! stack at ChildProcess.(/Users/egor/projects/ML/Simple TF/node_modules/@mapbox/node-pre-gyp/lib/util/compile.js:89:23) node-pre-gyp ERR! stack at ChildProcess.emit (node:events:514:28) node-pre-gyp ERR! stack at maybeClose (node:internal/child_process:1091:16) node-pre-gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:302:5) node-pre-gyp ERR! System Darwin 22.5.0 node-pre-gyp ERR! command "/Users/egor/.nvm/versions/node/v18.17.0/bin/node" "/Users/egor/projects/ML/Simple TF/node_modules/@tensorflow/tfjs-node/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build" node-pre-gyp ERR! cwd /Users/egor/projects/ML/Simple TF/node_modules/@tensorflow/tfjs-node node-pre-gyp ERR! node -v v18.17.0 node-pre-gyp ERR! node-pre-gyp -v v1.0.9 node-pre-gyp ERR! not ok`
my node params: ❯ node -e 'console.log(os.arch())' arm64 ❯ uname -m arm64 ❯ nvm ls v16.20.0 -> v18.17.0 v20.1.0 system
I know they were specifically working on M1 chip architecture, but I'm not sure if it's in place or not.
I found a few issues: https://github.com/tensorflow/tfjs/issues/6381
I had the same issue, turns out in my project directory I had folder name that includes white space. Remove that space delete node modules and package-lock.json then to run npm install again
I had the same issue, turns out in my project directory I had folder name that includes white space. Remove that space delete node modules and package-lock.json then to run npm install again
interesting! my project directory was also in a folder name w/ white space. i'll try a different directory w/o one.