Skip to content
This repository has been archived by the owner on Sep 17, 2022. It is now read-only.

Latest commit

 

History

History
54 lines (33 loc) · 2.23 KB

WINDOWS_TROUBLESHOOTING.md

File metadata and controls

54 lines (33 loc) · 2.23 KB

TensorFlow.js Node.js bindings Windows troubleshooting.

The tfjs-node package uses the node-gyp package to handle cross-compiling the C++ code required to bind TensorFlow to Node.js. This cross platform solution can be somewhat tricky on Windows platforms. This guide helps reference solutions that have been triaged through Issues on the main tfjs repo.

Ensure Python 2.x is installed

Currently, node-gyp requires Python 2.x to work properly. If Python 3.x is installed, you will see build failures. Also double check your python version python --version and update the Windows $PATH as needed.

'The system cannot find the patch specified' Exceptions

This can happen for a variety of reasons. First, to inspect what is missing either cd node_modules/@tensorflow/tfjs-node or clone the tensorflow/tfjs-node repo.

After cd'ing or cloning, run the following command (you might need node-gyp installed globablly npm install -g node-gyp):

node-gyp configure --verbose

Missing python2

From the verbose output, if you see something like:

gyp verb check python checking for Python executable "python2" in the PATH
gyp verb `which` failed Error: not found: python2

This means that node-gyp expects a 'python2' exe somewhere in %PATH%. Try running this command from an Admin (elevated privilaged prompt):

You can try running this from an Adminstrative prompt:

$ npm --add-python-to-path='true' --debug install --global windows-build-tools

Something else?

If another missing component shows up - please file an issue on tensorflow/tfjs with the output from the node-gyp configure --verbose command.

msbuild.exe Exceptions

Check the full stack trace from npm install (or yarn) command. If you see something like:

gyp ERR! stack Error: C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe failed with exit code: 1

You might need to install the system tools manually. This can be done via:

npm install -g --production windows-build-tools

If that still does not work - try re-running the command above in a privileged shell.