Tensor flow installation error

I am trying to install tensor flow but got error. Error log is as bellow

2023-06-23T10:28:37.356Z Install : node-red-contrib-tensorflow 0.4.2

2023-06-23T10:28:37.368Z npm.cmd install --no-audit --no-update-notifier --no-fund --save --save-prefix=~ --production --engine-strict node-red-contrib-tensorflow@0.4.2
2023-06-23T10:28:39.553Z [err] npm
2023-06-23T10:28:39.553Z [err]  WARN config production Use `--omit=dev` instead.
2023-06-23T10:28:56.600Z [err] npm
2023-06-23T10:28:56.601Z [err]  
2023-06-23T10:28:56.601Z [err] WARN deprecated request-promise@4.2.6: request-promise has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142
2023-06-23T10:30:26.083Z [err] npm
2023-06-23T10:30:26.083Z [err]  WARN cleanup Failed to remove some directories [
2023-06-23T10:30:26.083Z [err] npm WARN cleanup
2023-06-23T10:30:26.083Z [err]    [
2023-06-23T10:30:26.083Z [err] npm WARN 
2023-06-23T10:30:26.083Z [err] cleanup     'C:\\Users\\Admin\\.node-red\\node_modules\\@tensorflow\\tfjs-node',
2023-06-23T10:30:26.083Z [err] npm 
2023-06-23T10:30:26.083Z [err] WARN cleanup     [Error: EPERM: operation not permitted, rmdir 'C:\Users\Admin\.node-red\node_modules\@tensorflow\tfjs-node\deps\include'] {
2023-06-23T10:30:26.083Z [err] npm WARN cleanup       errno: -4048,
2023-06-23T10:30:26.083Z [err] npm
2023-06-23T10:30:26.084Z [err]  WARN cleanup       code: 'EPERM',
2023-06-23T10:30:26.084Z [err] npm
2023-06-23T10:30:26.084Z [err]  WARN cleanup       syscall: 'rmdir',
2023-06-23T10:30:26.084Z [err] npm
2023-06-23T10:30:26.084Z [err]  WARN cleanup       path: 'C:\\Users\\Admin\\.node-red\\node_modules\\@tensorflow\\tfjs-node\\deps\\include'
2023-06-23T10:30:26.084Z [err] npm WARN 
2023-06-23T10:30:26.084Z [err] cleanup     }
2023-06-23T10:30:26.084Z [err] npm WARN 
2023-06-23T10:30:26.084Z [err] cleanup   ]
2023-06-23T10:30:26.084Z [err] npm WARN cleanup
2023-06-23T10:30:26.084Z [err]  ]
2023-06-23T10:30:26.088Z [err] npm ERR!
2023-06-23T10:30:26.088Z [err]  code 1
2023-06-23T10:30:26.088Z [err] npm 
2023-06-23T10:30:26.088Z [err] ERR! path C:\Users\Admin\.node-red\node_modules\@tensorflow\tfjs-node
2023-06-23T10:30:26.091Z [err] npm ERR!
2023-06-23T10:30:26.091Z [err]  command failed
2023-06-23T10:30:26.091Z [err] npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c node scripts/install.js
2023-06-23T10:30:26.091Z [err] npm 
2023-06-23T10:30:26.092Z [err] ERR! CPU-windows-4.1.0.zip
2023-06-23T10:30:26.092Z [err] npm ERR! https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-cpu-windows-x86_64-2.9.1.zip
2023-06-23T10:30:26.092Z [err] npm ERR! node-pre-gyp install failed with error: Error: Command failed: node-pre-gyp install --fallback-to-build
2023-06-23T10:30:26.092Z [err] npm ERR!
2023-06-23T10:30:26.092Z [err]  node-pre-gyp info it worked if it ends with ok
2023-06-23T10:30:26.092Z [err] npm ERR! node-pre-gyp info using node-pre-gyp@1.0.9
2023-06-23T10:30:26.092Z [err] npm ERR!
2023-06-23T10:30:26.093Z [err]  node-pre-gyp info using node@18.16.0 | win32 | x64
2023-06-23T10:30:26.093Z [err] npm
2023-06-23T10:30:26.093Z [err]  
2023-06-23T10:30:26.093Z [err] ERR!
2023-06-23T10:30:26.093Z [err]  node-pre-gyp info check checked for "C:\Users\Admin\.node-red\node_modules\@tensorflow\tfjs-node\lib\napi-v8\tfjs_binding.node" (not found)
2023-06-23T10:30:26.093Z [err] npm
2023-06-23T10:30:26.093Z [err]  
2023-06-23T10:30:26.093Z [err] ERR!
2023-06-23T10:30:26.093Z [err]  node-pre-gyp http GET https://storage.googleapis.com/tf-builds/pre-built-binary/napi-v8/4.1.0/CPU-windows-4.1.0.zip
2023-06-23T10:30:26.094Z [err] npm
2023-06-23T10:30:26.094Z [err]  
2023-06-23T10:30:26.094Z [err] ERR!
2023-06-23T10:30:26.096Z [err]  node-pre-gyp ERR! install response status 404 Not Found on https://storage.googleapis.com/tf-builds/pre-built-binary/napi-v8/4.1.0/CPU-windows-4.1.0.zip 
2023-06-23T10:30:26.096Z [err] npm ERR! node-pre-gyp WARN Pre-built binaries not installable for @tensorflow/tfjs-node@4.1.0 and node@18.16.0 (node-v108 ABI, unknown) (falling back to source compile with node-gyp) 
2023-06-23T10:30:26.096Z [err] npm ERR! node-pre-gyp WARN Hit error response status 404 Not Found on https://storage.googleapis.com/tf-builds/pre-built-binary/napi-v8/4.1.0/CPU-windows-4.1.0.zip 
2023-06-23T10:30:26.096Z [err] npm ERR! gyp info it worked if it ends with ok
2023-06-23T10:30:26.096Z [err] npm ERR! gyp info using node-gyp@9.3.1
2023-06-23T10:30:26.096Z [err] npm ERR! gyp info using node@18.16.0 | win32 | x64
2023-06-23T10:30:26.096Z [err] npm ERR! gyp info ok 
2023-06-23T10:30:26.096Z [err] npm 
2023-06-23T10:30:26.096Z [err] ERR! gyp info it worked if it ends with ok
2023-06-23T10:30:26.096Z [err] npm ERR! gyp info using node-gyp@9.3.1
2023-06-23T10:30:26.096Z [err] npm
2023-06-23T10:30:26.097Z [err]  ERR! gyp info using node@18.16.0 | win32 | x64
2023-06-23T10:30:26.097Z [err] npm ERR!
2023-06-23T10:30:26.097Z [err]  gyp info find Python using Python version 3.11.4 found at "C:\Users\Admin\AppData\Local\Programs\Python\Python311\python.exe"
2023-06-23T10:30:26.097Z [err] npm 
2023-06-23T10:30:26.097Z [err] ERR! gyp ERR! find VS 
2023-06-23T10:30:26.097Z [err] npm ERR! gyp ERR! find VS msvs_version not set from command line or npm config
2023-06-23T10:30:26.097Z [err] npm
2023-06-23T10:30:26.098Z [err]  ERR! gyp ERR! find VS VCINSTALLDIR not set, not running in VS Command Prompt
2023-06-23T10:30:26.098Z [err] npm ERR! gyp ERR! find VS checking VS2022 (17.6.33723.286) found at:
2023-06-23T10:30:26.098Z [err] npm ERR! gyp ERR! find VS "C:\Program Files\Microsoft Visual Studio\2022\Community"
2023-06-23T10:30:26.098Z [err] npm ERR! gyp ERR! find VS - found "Visual Studio C++ core features"
2023-06-23T10:30:26.098Z [err] npm ERR! gyp ERR! find VS - missing any VC++ toolset
2023-06-23T10:30:26.098Z [err] npm ERR! gyp ERR! find VS could not find a version of Visual Studio 2017 or newer to use
2023-06-23T10:30:26.098Z [err] npm ERR! gyp ERR! find VS looking for Visual Studio 2015
2023-06-23T10:30:26.098Z [err] npm ERR! gyp ERR! find VS - not found
2023-06-23T10:30:26.098Z [err] npm ERR! gyp ERR! find VS not looking for VS2013 as it is only supported up to Node.js 8
2023-06-23T10:30:26.098Z [err] npm ERR! gyp ERR! find VS 
2023-06-23T10:30:26.098Z [err] npm ERR! gyp ERR! find VS **************************************************************
2023-06-23T10:30:26.098Z [err] npm ERR! gyp ERR! find VS You need to install the latest version of Visual Studio
2023-06-23T10:30:26.098Z [err] npm ERR! gyp ERR! find VS including the "Desktop development with C++" workload.
2023-06-23T10:30:26.098Z [err] npm ERR! gyp ERR! find VS For more information consult the documentation at:
2023-06-23T10:30:26.098Z [err] npm ERR! gyp ERR! find VS https://github.com/nodejs/node-gyp#on-windows
2023-06-23T10:30:26.098Z [err] npm ERR! gyp ERR! find VS **************************************************************
2023-06-23T10:30:26.098Z [err] npm ERR! gyp ERR! find VS 
2023-06-23T10:30:26.098Z [err] npm ERR! gyp ERR! configure error 
2023-06-23T10:30:26.098Z [err] npm ERR! gyp ERR! stack Error: Could not find any Visual Studio installation to use
2023-06-23T10:30:26.098Z [err] npm 
2023-06-23T10:30:26.098Z [err] ERR!
2023-06-23T10:30:26.098Z [err]  gyp ERR! stack     at VisualStudioFinder.fail (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:122:47)
2023-06-23T10:30:26.098Z [err] npm ERR! gyp ERR! stack     at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:75:16
2023-06-23T10:30:26.098Z [err] npm 
2023-06-23T10:30:26.098Z [err] ERR!
2023-06-23T10:30:26.098Z [err]  gyp ERR! stack     at VisualStudioFinder.findVisualStudio2013 (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:369:14)
2023-06-23T10:30:26.098Z [err] npm ERR! gyp ERR! stack     at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:71:14
2023-06-23T10:30:26.098Z [err] npm ERR! gyp ERR! stack     at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:390:16
2023-06-23T10:30:26.098Z [err] npm ERR! gyp ERR! stack     at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\util.js:54:7
2023-06-23T10:30:26.098Z [err] npm ERR! gyp ERR! stack     at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\util.js:33:16
2023-06-23T10:30:26.098Z [err] npm ERR! gyp ERR! stack     at ChildProcess.exithandler (node:child_process:427:5)
2023-06-23T10:30:26.098Z [err] npm 
2023-06-23T10:30:26.098Z [err] ERR! gyp ERR! stack     at ChildProcess.emit (node:events:513:28)
2023-06-23T10:30:26.098Z [err] npm ERR! gyp ERR! stack     at maybeClose (node:internal/child_process:1091:16)
2023-06-23T10:30:26.098Z [err] npm ERR! gyp ERR! System Windows_NT 10.0.19045
2023-06-23T10:30:26.098Z [err] npm ERR! gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "configure" "--fallback-to-build" "--module=C:\\Users\\Admin\\.node-red\\node_modules\\@tensorflow\\tfjs-node\\lib\\napi-v8\\tfjs_binding.node" "--module_name=tfjs_binding" "--module_path=C:\\Users\\Admin\\.node-red\\node_modules\\@tensorflow\\tfjs-node\\lib\\napi-v8" "--napi_version=8" "--node_abi_napi=napi" "--napi_build_version=8" "--node_napi_label=napi-v8"
2023-06-23T10:30:26.098Z [err] npm 
2023-06-23T10:30:26.098Z [err] ERR! gyp ERR! cwd C:\Users\Admin\.node-red\node_modules\@tensorflow\tfjs-node
2023-06-23T10:30:26.098Z [err] npm ERR!
2023-06-23T10:30:26.099Z [err]  gyp ERR! node -v v18.16.0
2023-06-23T10:30:26.099Z [err] npm ERR! gyp ERR! node-gyp -v v9.3.1
2023-06-23T10:30:26.099Z [err] npm ERR! gyp ERR! not ok 
2023-06-23T10:30:26.099Z [err] npm ERR!
2023-06-23T10:30:26.099Z [err]  node-pre-gyp ERR! build error 
2023-06-23T10:30:26.099Z [err] npm ERR!
2023-06-23T10:30:26.099Z [err]  node-pre-gyp ERR! stack Error: Failed to execute 'C:\Program Files\nodejs\node.exe C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --module=C:\Users\Admin\.node-red\node_modules\@tensorflow\tfjs-node\lib\napi-v8\tfjs_binding.node --module_name=tfjs_binding --module_path=C:\Users\Admin\.node-red\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)
2023-06-23T10:30:26.099Z [err] npm ERR! node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (C:\Users\Admin\.node-red\node_modules\@mapbox\node-pre-gyp\lib\util\compile.js:89:23)
2023-06-23T10:30:26.099Z [err] npm ERR!
2023-06-23T10:30:26.099Z [err]  node-pre-gyp ERR! stack     at ChildProcess.emit (node:events:513:28)
2023-06-23T10:30:26.099Z [err] npm ERR! node-pre-gyp ERR! stack     at maybeClose (node:internal/child_process:1091:16)
2023-06-23T10:30:26.099Z [err] npm ERR!
2023-06-23T10:30:26.099Z [err]  node-pre-gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:302:5)
2023-06-23T10:30:26.099Z [err] npm ERR! node-pre-gyp ERR! System Windows_NT 10.0.19045
2023-06-23T10:30:26.099Z [err] npm ERR! node-pre-gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Admin\\.node-red\\node_modules\\@mapbox\\node-pre-gyp\\bin\\node-pre-gyp" "install" "--fallback-to-build"
2023-06-23T10:30:26.099Z [err] npm
2023-06-23T10:30:26.099Z [err]  ERR! node-pre-gyp ERR! cwd C:\Users\Admin\.node-red\node_modules\@tensorflow\tfjs-node
2023-06-23T10:30:26.099Z [err] npm ERR!
2023-06-23T10:30:26.099Z [err]  node-pre-gyp ERR! node -v v18.16.0
2023-06-23T10:30:26.099Z [err] npm ERR! node-pre-gyp ERR! node-pre-gyp -v v1.0.9
2023-06-23T10:30:26.099Z [err] npm ERR! node-pre-gyp ERR! not ok
2023-06-23T10:30:26.099Z [err] npm 
2023-06-23T10:30:26.099Z [err] ERR! * Downloading libtensorflow
2023-06-23T10:30:26.099Z [err] npm ERR! 
2023-06-23T10:30:26.099Z [err] npm ERR! * Building TensorFlow Node.js bindings
2023-06-23T10:30:26.102Z [err] 
2023-06-23T10:30:26.102Z [err] npm 
2023-06-23T10:30:26.102Z [err] ERR! A complete log of this run can be found in:
2023-06-23T10:30:26.102Z [err] npm ERR!     C:\Users\Admin\AppData\Local\npm-cache\_logs\2023-06-23T10_28_39_513Z-debug-0.log
2023-06-23T10:30:26.204Z rc=1

Some nodes use native binaries. Some of them need compiling. This is one of those nodes.

If you read through the log you will see it cannot find suitable compilation tools.

Did you install the developer tools when you installed NODEJS?

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.