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

Error when a module try to install tensorflow #8275

Closed
Mad-Rage opened this issue May 8, 2024 · 4 comments
Closed

Error when a module try to install tensorflow #8275

Mad-Rage opened this issue May 8, 2024 · 4 comments

Comments

@Mad-Rage
Copy link

Mad-Rage commented May 8, 2024

Hello, puppeteer-hcaptcha need your package for work and should install himself, but I have this error :

npm error code 1
npm error path C:\Users\leand\Downloads\test\node_modules\puppeteer-hcaptcha\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-3.21.1.zip
npm error https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-cpu-windows-x86_64-2.9.1.zip
npm error * Downloading libtensorflow
npm error
npm error * Building TensorFlow Node.js bindings
npm error symlink ./lib/napi-v9 failed: Error: Command failed: node scripts/deps-stage.js symlink ./lib/napi-v9
npm error * Symlink of lib\napi-v9\tensorflow.dll failed, creating a copy on disk.
npm error node:internal/process/promises:288
npm error triggerUncaughtException(err, true /* fromPromise */);
npm error ^
npm error
npm error [Error: ENOENT: no such file or directory, copyfile 'C:\Users\leand\Downloads\test\node_modules\puppeteer-hcaptcha\node_modules@tensorflow\tfjs-node\deps\lib\tensorflow.dll' -> 'C:\Users\leand\Downloads\test\node_modules\puppeteer-hcaptcha\node_modules@tensorflow\tfjs-node\lib\napi-v9\tensorflow.dll'] {
npm error errno: -4058,
npm error code: 'ENOENT',
npm error syscall: 'copyfile',
npm error path: 'C:\Users\leand\Downloads\test\node_modules\puppeteer-hcaptcha\node_modules\@tensorflow\tfjs-node\deps\lib\tensorflow.dll',
npm error dest: 'C:\Users\leand\Downloads\test\node_modules\puppeteer-hcaptcha\node_modules\@tensorflow\tfjs-node\lib\napi-v9\tensorflow.dll'
npm error }
npm error
npm error Node.js v18.17.1
npm error
npm error at ChildProcess.exithandler (node:child_process:419:12)
npm error at ChildProcess.emit (node:events:514:28)
npm error at maybeClose (node:internal/child_process:1091:16)
npm error at ChildProcess._handle.onexit (node:internal/child_process:302:5) {
npm error code: 1,
npm error killed: false,
npm error signal: null,
npm error cmd: 'node scripts/deps-stage.js symlink ./lib/napi-v9'
npm error }

npm error A complete log of this run can be found in: C:\Users\leand\AppData\Local\npm-cache_logs\2024-05-08T21_34_23_510Z-debug-0.log

@gaikwadrahul8
Copy link
Contributor

gaikwadrahul8 commented May 10, 2024

Hi, @Mad-Rage

I apologize for the delay in responding, following the instructions mentioned in my #8081 (comment) with these Node.js versions Node.js v19.9.0 and Node.js v18.16.1 it should work with Python version 3.x and less than Python version 3.12.x (e.g 3.11.x,3.10.x or 3.9.x) and at the moment it's not working as expected with Node.js v18.17.1

I believe you're following these official documentation Ref-1, Ref-2 and node-gyp - Node.js native addon build tool for Windows

In general you'll have to follow below steps to install @tensorflow/tfjs-node on Windows system:

  • Edit the path user or system variable, ensure that the path to python is added to the path variable.
  • Install Visual Studio community edition with desktop development with C++ Link
  • Install visual studio build tools with the help of Visual Studio Installer
  • Ensure that node-gyp is available: npm install -g node-gyp
  • Install tfjs-node: npm install @tensorflow/tfjs-node

tfjs-node requires AVX processors and tfjs-node library uses AVX instructions to improve the performance of its operations. If your CPU does not support AVX, as far I know you will not be able to use tfjs-node if I'm not wrong so to check AVX support please follow below steps

  • Right-click on the Start button and select "System Information."
  • Expand the "Processor" category in the left-hand pane.
  • Look for "Instruction Set" or "Extended Instructions" in the right-hand pane. If AVX is supported, you should see it listed there (e.g., "AVX2").

NOTE : If the above workaround does not work please try using your mobile phone's hotspot to connect your computer to the internet. This alternative connection might fix the installation issue.

Please let us know after trying the above steps is it resolving your issue or not ? if not please help us with the error log to investigate this issue further

Thank you for your cooperation and patience.

@gaikwadrahul8
Copy link
Contributor

Hi, @Mad-Rage

To confirm, were you able to successfully install tfjs-node on your Windows system by following the provided instructions in my previous comment ? if so please feel free to close this issue from your end

If issue still persists please help us with new error log for further investigation after running this command node-gyp configure in the terminal.

Thank you for your cooperation and patience

@gaikwadrahul8
Copy link
Contributor

Hi, @Mad-Rage

To confirm, were you able to successfully install tfjs-node on your Windows 11 system by following the provided instructions in my previous comment ? if so please feel free to close this issue from your end

If issue still persists please help us with new error log for further investigation after running this command node-gyp configure in the terminal.

Thank you for your cooperation and patience

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