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

Problem npm installing - @tensorflow/tfjs-node on windows #8522

Open
doppelgunner opened this issue Feb 22, 2025 · 3 comments
Open

Problem npm installing - @tensorflow/tfjs-node on windows #8522

doppelgunner opened this issue Feb 22, 2025 · 3 comments
Assignees

Comments

@doppelgunner
Copy link

System information

  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Windows 11, version 24H2
  • TensorFlow.js installed from (npm or script link): npm
  • TensorFlow.js version: 4.22.0

Problem Description

  • problem with this command: npm i @tensorflow/tfjs-node

Provide the exact sequence of commands / steps that you executed before running into the problem

  1. npm i @tensorflow/tfjs-node

Any other info / logs

C:\Users\Robert\Documents\codes\blur-it>npm i @tensorflow/tfjs-node
npm warn deprecated [email protected]: This package is no longer supported.
npm warn deprecated [email protected]: Rimraf versions prior to v4 are no longer supported
npm warn deprecated [email protected]: This package is no longer supported.
npm warn deprecated [email protected]: This package is no longer supported.
npm error code 1
npm error path C:\Users\Robert\Documents\codes\blur-it\node_modules\@tensorflow\tfjs-node
npm error command failed
npm error command C:\WINDOWS\system32\cmd.exe /d /s /c node scripts/install.js
npm error CPU-windows-4.22.0.zip
npm error https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-cpu-windows-x86_64-2.9.1.zip
npm error node-pre-gyp install failed with error: Error: Command failed: node-pre-gyp install --fallback-to-build
npm error node-pre-gyp info it worked if it ends with ok
npm error node-pre-gyp info using [email protected]
npm error node-pre-gyp info using [email protected] | win32 | x64
npm error node-pre-gyp info check checked for "C:\Users\Robert\Documents\codes\blur-it\node_modules\@tensorflow\tfjs-node\lib\napi-v8\tfjs_binding.node" (not found)
npm error node-pre-gyp http GET https://storage.googleapis.com/tf-builds/pre-built-binary/napi-v8/4.22.0/CPU-windows-4.22.0.zip
npm error node-pre-gyp ERR! install response status 404 Not Found on https://storage.googleapis.com/tf-builds/pre-built-binary/napi-v8/4.22.0/CPU-windows-4.22.0.zip
npm error 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)
npm error node-pre-gyp WARN Hit error response status 404 Not Found on https://storage.googleapis.com/tf-builds/pre-built-binary/napi-v8/4.22.0/CPU-windows-4.22.0.zip
npm error gyp info it worked if it ends with ok
npm error gyp info using [email protected]
npm error gyp info using [email protected] | win32 | x64
npm error gyp info ok
npm error gyp info it worked if it ends with ok
npm error gyp info using [email protected]
npm error gyp info using [email protected] | win32 | x64
npm error gyp info find Python using Python version 3.13.2 found at "C:\Users\Robert\AppData\Local\Programs\Python\Python313\python.exe"
npm error gyp ERR! find VS
npm error gyp ERR! find VS msvs_version not set from command line or npm config
npm error gyp ERR! find VS VCINSTALLDIR not set, not running in VS Command Prompt
npm error gyp ERR! find VS could not use PowerShell to find Visual Studio 2017 or newer, try re-running with '--loglevel silly' for more details.
npm error gyp ERR! find VS
npm error gyp ERR! find VS Failure details: undefined
npm error gyp ERR! find VS could not use PowerShell to find Visual Studio 2017 or newer, try re-running with '--loglevel silly' for more details.
npm error gyp ERR! find VS
npm error gyp ERR! find VS Failure details: undefined
npm error gyp ERR! find VS could not use PowerShell to find Visual Studio 2017 or newer, try re-running with '--loglevel silly' for more details.
npm error gyp ERR! find VS
npm error gyp ERR! find VS Failure details: undefined
npm error gyp ERR! find VS could not use PowerShell to find Visual Studio 2017 or newer, try re-running with '--loglevel silly' for more details.
npm error gyp ERR! find VS
npm error gyp ERR! find VS Failure details: undefined
npm error gyp ERR! find VS not looking for VS2015 as it is only supported up to Node.js 18
npm error gyp ERR! find VS not looking for VS2013 as it is only supported up to Node.js 8
npm error gyp ERR! find VS
npm error gyp ERR! find VS **************************************************************
npm error gyp ERR! find VS You need to install the latest version of Visual Studio
npm error gyp ERR! find VS including the "Desktop development with C++" workload.
npm error gyp ERR! find VS For more information consult the documentation at:
npm error gyp ERR! find VS https://github.com/nodejs/node-gyp#on-windows
npm error gyp ERR! find VS **************************************************************
npm error gyp ERR! find VS
npm error gyp ERR! configure error
npm error gyp ERR! stack Error: Could not find any Visual Studio installation to use
npm error gyp ERR! stack at VisualStudioFinder.fail (C:\Users\Robert\AppData\Roaming\nvm\v20.15.0\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:116:11)
npm error gyp ERR! stack at VisualStudioFinder.findVisualStudio (C:\Users\Robert\AppData\Roaming\nvm\v20.15.0\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:72:17)
npm error gyp ERR! stack at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
npm error gyp ERR! stack at async createBuildDir (C:\Users\Robert\AppData\Roaming\nvm\v20.15.0\node_modules\npm\node_modules\node-gyp\lib\configure.js:95:26)
npm error gyp ERR! stack at async run (C:\Users\Robert\AppData\Roaming\nvm\v20.15.0\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js:81:18)
npm error gyp ERR! System Windows_NT 10.0.26100
npm error gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Robert\\AppData\\Roaming\\nvm\\v20.15.0\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "configure" "--fallback-to-build" "--module=C:\\Users\\Robert\\Documents\\codes\\blur-it\\node_modules\\@tensorflow\\tfjs-node\\lib\\napi-v8\\tfjs_binding.node" "--module_name=tfjs_binding" "--module_path=C:\\Users\\Robert\\Documents\\codes\\blur-it\\node_modules\\@tensorflow\\tfjs-node\\lib\\napi-v8" "--napi_version=9" "--node_abi_napi=napi" "--napi_build_version=8" "--node_napi_label=napi-v8"
npm error gyp ERR! cwd C:\Users\Robert\Documents\codes\blur-it\node_modules\@tensorflow\tfjs-node
npm error gyp ERR! node -v v20.15.0
npm error gyp ERR! node-gyp -v v10.1.0
npm error gyp ERR! not ok
npm error node-pre-gyp ERR! build error
npm error node-pre-gyp ERR! stack Error: Failed to execute 'C:\Program Files\nodejs\node.exe C:\Users\Robert\AppData\Roaming\nvm\v20.15.0\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --module=C:\Users\Robert\Documents\codes\blur-it\node_modules\@tensorflow\tfjs-node\lib\napi-v8\tfjs_binding.node --module_name=tfjs_binding --module_path=C:\Users\Robert\Documents\codes\blur-it\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)
npm error node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (C:\Users\Robert\Documents\codes\blur-it\node_modules\@mapbox\node-pre-gyp\lib\util\compile.js:89:23)
npm error node-pre-gyp ERR! stack     at ChildProcess.emit (node:events:519:28)
npm error node-pre-gyp ERR! stack     at maybeClose (node:internal/child_process:1105:16)
npm error node-pre-gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:305:5)
npm error node-pre-gyp ERR! System Windows_NT 10.0.26100
npm error node-pre-gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Robert\\Documents\\codes\\blur-it\\node_modules\\@mapbox\\node-pre-gyp\\bin\\node-pre-gyp" "install" "--fallback-to-build"
npm error node-pre-gyp ERR! cwd C:\Users\Robert\Documents\codes\blur-it\node_modules\@tensorflow\tfjs-node
npm error node-pre-gyp ERR! node -v v20.15.0
npm error node-pre-gyp ERR! node-pre-gyp -v v1.0.9
npm error node-pre-gyp ERR! not ok
npm error * Downloading libtensorflow
npm error
npm error * Building TensorFlow Node.js bindings

npm error A complete log of this run can be found in: C:\Users\Robert\AppData\Local\npm-cache\_logs\2025-02-22T12_57_42_052Z-debug-0.log
@doppelgunner doppelgunner changed the title Problem npm installing - @tensorflow/tfjs-node Problem npm installing - @tensorflow/tfjs-node on windows Feb 22, 2025
@fernandopraise
Copy link

Hello, I also have this problem

Image

@doppelgunner
Copy link
Author

It turns out, it worked fine on ubuntu,
I rented out a $6/month droplet on digitalocean and I was able to install tfjs-node easily. I think it was made for ubuntu OS.

Maybe we can use docker container for development but still have intellisense of vscode? or we can use vscode.dev?

@shmishra99 shmishra99 self-assigned this Feb 25, 2025
@shmishra99
Copy link
Contributor

shmishra99 commented Feb 25, 2025

Hi @doppelgunner,

The @tensorflow/tfjs-node package on windows has a known issue: tfjs_binding.node is missing from node_modules\@tensorflow\tfjs-node\lib\napi-v8\. You can manually copy tfjs_binding.node file from node_modules\@tensorflow\tfjs-node\build-tmp-napi-v8\Release to node_modules\@tensorflow\tfjs-node\lib\napi-v8\ as a workaround.

Let me know if it helps. Thank You!!

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

3 participants