Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installation failed for tfjs-node 3.9.0 on windows with Node 12 #5603

Closed
fbx31 opened this issue Sep 10, 2021 · 3 comments
Closed

Installation failed for tfjs-node 3.9.0 on windows with Node 12 #5603

fbx31 opened this issue Sep 10, 2021 · 3 comments
Assignees

Comments

@fbx31
Copy link

fbx31 commented Sep 10, 2021

Please make sure that this is a build/installation issue. As per our GitHub Policy, we only address code/doc bugs, performance issues, feature requests and build/installation issues on GitHub. tag:build_template

System information

  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Windows
  • Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device:
  • TensorFlow.js installed from (npm or script link): npm
  • TensorFlow.js version: 3.9.0
  • CUDA/cuDNN version: NA

npm install of tfjs-node fails on windows

Provide the exact sequence of commands / steps that you executed before running into the problem
npm i @tensorflow/tfjs-node

Logs

@tensorflow/[email protected] install C:\Users\xxxxxxxxxxxxxxxxxxxx\node_modules@tensorflow\tfjs-node
node scripts/install.js

CPU-windows-3.9.0.zip

  • Downloading libtensorflow
    https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-cpu-windows-x86_64-2.5.0.zip
    [==============================] 8649874/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 ERR! install response status 404 Not Found on https://storage.googleapis.com/tf-builds/pre-built-binary/napi-v8/3.9.0/CPU-windows-3.9.0.zip
    node-pre-gyp WARN Pre-built binaries not installable for @tensorflow/[email protected] and [email protected] (node-v72 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.9.0/CPU-windows-3.9.0.zip
    gyp WARN install got an error, rolling back install
    gyp ERR! configure error
    gyp ERR! stack Error: self signed certificate in certificate chain
    gyp ERR! stack at TLSSocket.onConnectSecure (_tls_wrap.js:1502:34)
    gyp ERR! stack at TLSSocket.emit (events.js:314:20)
    gyp ERR! stack at TLSSocket._finishInit (_tls_wrap.js:937:8)
    gyp ERR! stack at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:711:12)
    gyp ERR! System Windows_NT 10.0.18363
    gyp ERR! command "C:\Users\xxxxxxxxxxxxx\node.exe" "C:\Users\txxxxxxxxxxx\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "configure" "--fallback-to-build" "--module=C:\Users\xxxxxxxxxxxxxx\node_modules\@tensorflow\tfjs-node\lib\napi-v8\tfjs_binding.node" "--module_name=tfjs_binding" "--module_path=C:\Users\xxxxxxxxxxx\node_modules\@tensorflow\tfjs-node\lib\napi-v8" "--napi_version=8" "--node_abi_napi=napi" "--napi_build_version=8" "--node_napi_label=napi-v8"
    gyp ERR! cwd C:\Users\xxxxxxxx\node_modules@tensorflow\tfjs-node
    gyp ERR! node -v v12.22.5
    gyp ERR! node-gyp -v v5.1.0
    gyp ERR! not ok
    node-pre-gyp ERR! build error
    node-pre-gyp ERR! stack Error: Failed to execute 'C:\Users\xxxxxxxxx\node.exe C:\Usersxxxxxxxxxx\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --module=C:\Users\xxxxxxxxx\node_modules@tensorflow\tfjs-node\lib\napi-v8\tfjs_binding.node --module_name=tfjs_binding --module_path=C:\Users\xxxxxxxx\node_modules@tensorflow\tfjs-node\lib\napi-v8 --napi_version=8 --node_abi_napi=napi --napi_build_version=8 --node_napi_label=napi-v8' (1)
    node-pre-gyp ERR! stack at ChildProcess. (C:\Users\xxxxx\node_modules@mapbox\node-pre-gyp\lib\util\compile.js:89:23)
    node-pre-gyp ERR! stack at ChildProcess.emit (events.js:314:20)
    node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:1022:16)
    node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:287:5)
    node-pre-gyp ERR! System Windows_NT 10.0.18363
    node-pre-gyp ERR! command "C:\Users\xxxxxxxx\node.exe" "C:\Users\xxxxxxxxnode_modules\@mapbox\node-pre-gyp\bin\node-pre-gyp" "install" "--fallback-to-build"
    node-pre-gyp ERR! cwd C:\Users\xxxxxxxxx\node_modules@tensorflow\tfjs-node
    node-pre-gyp ERR! node -v v12.22.5
    node-pre-gyp ERR! node-pre-gyp -v v1.0.4
    node-pre-gyp ERR! not ok
@mattsoulanille
Copy link
Member

The 404 on the prebuilt binary is actually expected since I don't believe we ship Node-API version 8 binaries yet. This should not matter though, since the install should fall back to compiling from source, and it looks like that's where it failed.

This looks like it could be related to certificates, since it's complaining about a self-signed certificate in the chain (gyp ERR! stack Error: self signed certificate in certificate chain). Apparently, this can be caused by being behind a corporate firewall. Certificates are outside my area of expertise, but you might find an answer on this issue.

@mattsoulanille mattsoulanille self-assigned this Sep 10, 2021
@fbx31
Copy link
Author

fbx31 commented Sep 13, 2021

Hello, thanks for the link where I find a work around to install for the first time the tensorflow nodejs librariries.
Using set NODE_TLS_REJECT_UNAUTHORIZED=0 before launching the install. Didn't succeed with the solution of default certificates up to now.
Thank you

@fbx31 fbx31 closed this as completed Sep 13, 2021
@google-ml-butler
Copy link

Are you satisfied with the resolution of your issue?
Yes
No

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants