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

Cant install on windows 11 #7793

Closed
bbauti opened this issue Jun 30, 2023 · 18 comments
Closed

Cant install on windows 11 #7793

bbauti opened this issue Jun 30, 2023 · 18 comments

Comments

@bbauti
Copy link

bbauti commented Jun 30, 2023

Help! i cant install tfjs on windows 11.

"npm i @tensorflow/tfjs-node@3.18" didnt work too

edit: running as admin didnt work too

node-gyp configure --verbose:

gyp info it worked if it ends with ok
gyp verb cli [
gyp verb cli   'C:\\Program Files\\nodejs\\node.exe',
gyp verb cli   'C:\\Users\\bauti\\AppData\\Roaming\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js',
gyp verb cli   'configure',
gyp verb cli   '--verbose'
gyp verb cli ]
gyp info using node-gyp@9.4.0
gyp info using node@20.3.1 | win32 | x64
gyp verb command configure []
gyp verb find Python Python is not set from command line or npm configuration
gyp verb find Python Python is not set from environment variable PYTHON
gyp verb find Python checking if "python3" can be used
gyp verb find Python - executing "python3" to get executable path
gyp verb find Python - executable path is "C:\QMK_MSYS\mingw64\bin\python3.exe"
gyp verb find Python - executing "C:\QMK_MSYS\mingw64\bin\python3.exe" to get version
gyp verb find Python - version is "3.10.6"
gyp info find Python using Python version 3.10.6 found at "C:\QMK_MSYS\mingw64\bin\python3.exe"
gyp verb get node dir no --target version specified, falling back to host node version: 20.3.1
gyp verb command install [ '20.3.1' ]
gyp verb install input version string "20.3.1"
gyp verb install installing version: 20.3.1
gyp verb install --ensure was passed, so won't reinstall if already installed
gyp verb install version is already installed, need to check "installVersion"
gyp verb got "installVersion" 11
gyp verb needs "installVersion" 11
gyp verb install version is good
gyp verb on Windows; need to check node.lib
gyp verb get node dir target node version installed: 20.3.1
gyp verb build dir attempting to create "build" dir: C:\Users\bauti\tfjs\build
gyp verb build dir "build" dir needed to be created? No
gyp verb find VS msvs_version not set from command line or npm config
gyp verb find VS VCINSTALLDIR not set, not running in VS Command Prompt
gyp verb find VS checking VS2022 (17.6.33815.320) found at:
gyp verb find VS "C:\Program Files\Microsoft Visual Studio\2022\Community"
gyp verb find VS - found "Visual Studio C++ core features"
gyp verb find VS - found VC++ toolset: v143
gyp verb find VS - found Windows SDK: 10.0.22000.0
gyp info find VS using VS2022 (17.6.33815.320) found at:
gyp info find VS "C:\Program Files\Microsoft Visual Studio\2022\Community"
gyp info find VS run with --verbose for detailed information
gyp verb build/config.gypi creating config file
gyp verb build/config.gypi writing out config file: C:\Users\bauti\tfjs\build\config.gypi
gyp verb config.gypi checking for gypi file: C:\Users\bauti\tfjs\config.gypi
gyp verb common.gypi checking for gypi file: C:\Users\bauti\tfjs\common.gypi
gyp verb gyp gyp format was not specified; forcing "msvs"
gyp info spawn C:\QMK_MSYS\mingw64\bin\python3.exe
gyp info spawn args [
gyp info spawn args   'C:\\Users\\bauti\\AppData\\Roaming\\npm\\node_modules\\node-gyp\\gyp\\gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'msvs',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Users\\bauti\\tfjs\\build\\config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Users\\bauti\\AppData\\Roaming\\npm\\node_modules\\node-gyp\\addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Users\\bauti\\AppData\\Local\\node-gyp\\Cache\\20.3.1\\include\\node\\common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=C:\\Users\\bauti\\AppData\\Local\\node-gyp\\Cache\\20.3.1',
gyp info spawn args   '-Dnode_gyp_dir=C:\\Users\\bauti\\AppData\\Roaming\\npm\\node_modules\\node-gyp',
gyp info spawn args   '-Dnode_lib_file=C:\\\\Users\\\\bauti\\\\AppData\\\\Local\\\\node-gyp\\\\Cache\\\\20.3.1\\\\<(target_arch)\\\\node.lib',
gyp info spawn args   '-Dmodule_root_dir=C:\\Users\\bauti\\tfjs',
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   'C:\\Users\\bauti\\tfjs\\build',
gyp info spawn args   '-Goutput_dir=.'
gyp info spawn args ]
Warning: Missing input files:
C:\Program Files
odejs
gyp info ok

npm install @tensorflow/tfjs-node:

npm WARN cleanup Failed to remove some directories [
npm WARN cleanup   [
npm WARN cleanup     'C:\\Users\\bauti\\AppData\\Roaming\\npm\\node_modules\\@tensorflow\\tfjs-node\\node_modules\\@mapbox',
npm WARN cleanup     [Error: EPERM: operation not permitted, rmdir 'C:\Users\bauti\AppData\Roaming\npm\node_modules\@tensorflow\tfjs-node\node_modules\@mapbox\node-pre-gyp\lib'] {
npm WARN cleanup       errno: -4048,
npm WARN cleanup       code: 'EPERM',
npm WARN cleanup       syscall: 'rmdir',
npm WARN cleanup       path: 'C:\\Users\\bauti\\AppData\\Roaming\\npm\\node_modules\\@tensorflow\\tfjs-node\\node_modules\\@mapbox\\node-pre-gyp\\lib'
npm WARN cleanup     }
npm WARN cleanup   ],
npm WARN cleanup   [
npm WARN cleanup     'C:\\Users\\bauti\\AppData\\Roaming\\npm\\node_modules\\@tensorflow\\tfjs-node',
npm WARN cleanup     [Error: EPERM: operation not permitted, rmdir 'C:\Users\bauti\AppData\Roaming\npm\node_modules\@tensorflow\tfjs-node\node_modules'] {
npm WARN cleanup       errno: -4048,
npm WARN cleanup       code: 'EPERM',
npm WARN cleanup       syscall: 'rmdir',
npm WARN cleanup       path: 'C:\\Users\\bauti\\AppData\\Roaming\\npm\\node_modules\\@tensorflow\\tfjs-node\\node_modules'
npm WARN cleanup     }
npm WARN cleanup   ]
npm WARN cleanup ]
npm ERR! code 1
npm ERR! path C:\Users\bauti\AppData\Roaming\npm\node_modules\@tensorflow\tfjs-node
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c node scripts/install.js
npm ERR! CPU-windows-4.8.0.zip
npm ERR! https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-cpu-windows-x86_64-2.9.1.zip
npm ERR! * Downloading libtensorflow
npm ERR!
npm ERR! * Building TensorFlow Node.js bindings
npm ERR! symlink ./lib/napi-v9 failed:  Error: Command failed: node scripts/deps-stage.js symlink ./lib/napi-v9
npm ERR!   * Symlink of lib\napi-v9\tensorflow.dll failed, creating a copy on disk.
npm ERR! node:internal/process/promises:289
npm ERR!             triggerUncaughtException(err, true /* fromPromise */);
npm ERR!             ^
npm ERR!
npm ERR! [Error: ENOENT: no such file or directory, copyfile 'C:\Users\bauti\AppData\Roaming\npm\node_modules\@tensorflow\tfjs-node\deps\lib\tensorflow.dll' -> 'C:\Users\bauti\AppData\Roaming\npm\node_modules\@tensorflow\tfjs-node\lib\napi-v9\tensorflow.dll'] {
npm ERR!   errno: -4058,
npm ERR!   code: 'ENOENT',
npm ERR!   syscall: 'copyfile',
npm ERR!   path: 'C:\\Users\\bauti\\AppData\\Roaming\\npm\\node_modules\\@tensorflow\\tfjs-node\\deps\\lib\\tensorflow.dll',
npm ERR!   dest: 'C:\\Users\\bauti\\AppData\\Roaming\\npm\\node_modules\\@tensorflow\\tfjs-node\\lib\\napi-v9\\tensorflow.dll'
npm ERR! }
npm ERR!
npm ERR! Node.js v20.3.1
npm ERR!
npm ERR!     at ChildProcess.exithandler (node:child_process:419:12)
npm ERR!     at ChildProcess.emit (node:events:511:28)
npm ERR!     at maybeClose (node:internal/child_process:1098:16)
npm ERR!     at ChildProcess._handle.onexit (node:internal/child_process:304:5) {
npm ERR!   code: 1,
npm ERR!   killed: false,
npm ERR!   signal: null,
npm ERR!   cmd: 'node scripts/deps-stage.js symlink ./lib/napi-v9'
npm ERR! }
@gaikwadrahul8
Copy link
Contributor

gaikwadrahul8 commented Jun 30, 2023

Hi, @bbauti

Thank you for bringing this issue to our attention, by looking at your error log, you're trying to use this command npm install @tensorflow/tfjs-node so by default it will install latest version of @tensorflow/tfjs-node which is 4.8.0 and at the moment we don't support that version on Windows machine so last supported version is 3.18.0 for tensorflow/tfjs-node on Windows machine so could you please try to run this command npm i @tensorflow/tfjs-node@3.18.0 and let us know whether is it working or not as expected ?

I see in your log currently you're using python 3.10.6 so could you please give it try by downgrading that python version to 3.8 0R 3.9 please ?

If issue still persists please share error log as above with @tensorflow/tfjs-node@3.18.0 which will help us to investigate your issue as quickly as possible ? Thank you!

@github-actions
Copy link

github-actions bot commented Jul 8, 2023

This issue has been marked stale because it has no recent activity since 7 days. It will be closed if no further activity occurs. Thank you.

@github-actions github-actions bot added the stale label Jul 8, 2023
@github-actions
Copy link

This issue was closed due to lack of activity after being marked stale for past 7 days.

@google-ml-butler
Copy link

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

@Hexorshift
Copy link

Hexorshift commented Jul 16, 2023

I'm getting the same error.

Windows 11
Node 20.4.0
Python 3.8.10
@tensorflow/tfjs-node@3.18.0

C:\Users\zylea\Desktop\Test>npm i @tensorflow/tfjs-node@3.18.0
npm ERR! code 1
npm ERR! path C:\Users\zylea\Desktop\Test\node_modules\@tensorflow\tfjs-node
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c node scripts/install.js
npm ERR! CPU-windows-3.18.0.zip
npm ERR! https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-cpu-windows-x86_64-2.7.0.zip
npm ERR! * Downloading libtensorflow
npm ERR! 
npm ERR! * Building TensorFlow Node.js bindings
npm ERR! symlink ./lib/napi-v9 failed:  Error: Command failed: node scripts/deps-stage.js symlink ./lib/napi-v9
npm ERR!   * Symlink of lib\napi-v9\tensorflow.dll failed, creating a copy on disk.
npm ERR! node:internal/process/promises:289
npm ERR!             triggerUncaughtException(err, true /* fromPromise */);
npm ERR!             ^
npm ERR! 
npm ERR! [Error: ENOENT: no such file or directory, copyfile 'C:\Users\zylea\Desktop\Test\node_modules\@tensorflow\tfjs-node\deps\lib\tensorflow.dll' -> 'C:\Users\zylea\Desktop\Test\node_modules\@tensorflow\tfjs-node\lib\napi-v9\tensorflow.dll'] {
npm ERR!   errno: -4058,
npm ERR!   code: 'ENOENT',
npm ERR!   syscall: 'copyfile',
npm ERR!   path: 'C:\\Users\\zylea\\Desktop\\Test\\node_modules\\@tensorflow\\tfjs-node\\deps\\lib\\tensorflow.dll',
npm ERR!   dest: 'C:\\Users\\zylea\\Desktop\\Test\\node_modules\\@tensorflow\\tfjs-node\\lib\\napi-v9\\tensorflow.dll'
npm ERR! }
npm ERR! 
npm ERR! Node.js v20.4.0
npm ERR! 
npm ERR!     at ChildProcess.exithandler (node:child_process:419:12)
npm ERR!     at ChildProcess.emit (node:events:512:28)
npm ERR!     at maybeClose (node:internal/child_process:1098:16)
npm ERR!     at ChildProcess._handle.onexit (node:internal/child_process:304:5) {
npm ERR!   code: 1,
npm ERR!   killed: false,
npm ERR!   signal: null,
npm ERR!   cmd: 'node scripts/deps-stage.js symlink ./lib/napi-v9'
npm ERR! }

@DutchKevv
Copy link

Same,

Also tried with Node 18, same errors

@TobCraft3521
Copy link

TobCraft3521 commented Jul 24, 2023

In github tfjs installation guide it says you need python 2.x I got the same error with python 3.8(+) and im trying 2.7
https://github.com/tensorflow/tfjs-node/blob/master/tfjs-node/WINDOWS_TROUBLESHOOTING.md#ensure-python-2x-is-installed EDIT: doesnt work - still same error + i did add it to path

@reinvanhaaren
Copy link

I had the same error: symlink ./lib/napi-v9 failed: Error: Command failed: node scripts/deps-stage.js symlink ./lib/napi-v9

My solution (after a few hours debugging) was downgrading Node.js version from 18.17.0 to 18.16.1.

Note: I run my build on GitHub Actions with windows-latest.

@panella87
Copy link

I had the same error: symlink ./lib/napi-v9 failed: Error: Command failed: node scripts/deps-stage.js symlink ./lib/napi-v9

My solution (after a few hours debugging) was downgrading Node.js version from 18.17.0 to 18.16.1.

Note: I run my build on GitHub Actions with windows-latest.

Thanks, this worked for me

@vivanov-dp
Copy link

vivanov-dp commented Aug 29, 2023

Indeed, going back to Node v18.16.1 solves the problem for me, thanks @reinvanhaaren

I'd like to add that the error occurs when the install script tries to copy the downloaded tensorflow.dll file to node_modules/@tensorflow/tfjs-node/lib/napi-v9/ - the folder napi-v9 does not exist, instead there is napi-v8.

Probably the napi version changed at v18.17.0 and some of the install scripts find and use the new version, while the others have it hardcoded.

@mustafaekim
Copy link

Unfortunately we have no chance of going back, we need to move to node 20, is there any solution to this?

@vivanov-dp
Copy link

@gaikwadrahul8 Hey, perhaps you could reopen this issue and give it a go? With all the information people posted it should be doable - @Zyleaf even supplied the error logs with the software versions requested by you

@108EAA0A
Copy link

I had the same problem on windows 11.
I solved it by lowering from node 20.x to 18.16.1.

@gaikwadrahul8
Copy link
Contributor

Hi, All

I'm glad to hear that the issue has been resolved by downgrading the Node.js version to 18.16.1. This is a known issue that we are tracking in issue #7341 and our developer team is working on it to resolve that issue with latest Node.js versions. Please refer to #7341 issue for future updates. Thank you for your patience and cooperation. Thank you!

@GianpaoloPascasi
Copy link

GianpaoloPascasi commented Nov 23, 2023

I have the following setup:
Windows 11
Node 18.17.0
Tensorflow Node: 3.9
Tensorflow Node-GPU: 3.18
VSCode community 22
Python 3.10

I found myself to have the same problem of
symlink ./lib/napi-v9 failed: Error: Command failed: node scripts/deps-stage.js symlink ./lib/napi-v9
for cpu and gpu libs.
The only workaround i found is to manually create the directories while you are running the install, something like
mkdir "@tensorflow\tfjs-node\lib\napi-v9" | mkdir "@tensorflow\tfjs-node-gpu\lib\napi-v9" from the node_modules directory.
Then make sure to copy also the file tfjs_binding.node in node_modules\@tensorflow\tfjs-node-gpu\lib\napi-v9 to node_modules\@tensorflow\tfjs-node-gpu\lib\napi-v8 (same applies to tfjs-node if needed).

@teddybee
Copy link

teddybee commented Nov 23, 2023

Same problem here, NodeJS 20.10 and python 3.11

Error: Command failed: node scripts/deps-stage.js symlink ./lib/napi-v9
│   * Symlink of lib\napi-v9\tensorflow.dll failed, creating a copy on disk.

@kyan0045
Copy link

kyan0045 commented Jan 1, 2024

Still getting this issue, really annoying since I can't downgrade atm

@gaikwadrahul8
Copy link
Contributor

Hi, @GianpaoloPascasi , @teddybee , @kyan0045

I apologize for the delayed response and our relavant team is aware of this known issue and team is working on this issue so at the moment the workaround is to to use either Node.js v19.9.0 or Node.js v18.16.1 and it should work, I already tested on both Windows 10 and Windows 11 systems from Python 3.6 to Python 3.11

Please note more one thig at the moment it's not working with Python 3.12 also so please try with Python version in between Python 3.6 to Python 3.11. Please refer this issue thread for future update #7341.

Thank you for your understanding and patience.

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