Unable to install @tensorflow/tfjs-node

See original GitHub issue

I am unable to install @tensorflow/tfjs-node. I’d appreciate it if someone can shed some light and let me know what I’m missing. I’m running the following:

  • Windows 10 Pro version 1803
  • node v10.13.0
  • npm 6.4.1
  • Python 2.7.15

C:\Users\jcruz\Documents\nodejs\demo>node -v

v10.13.0

C:\Users\jcruz\Documents\nodejs\demo>npm --v

6.4.1

C:\Users\jcruz\Documents\nodejs\demo>python

Python 2.7.15 (v2.7.15:ca079a3ea3, Apr 30 2018, 16:30:26) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> exit()

C:\Users\jcruz\Documents\nodejs\demo>npm install @tensorflow/tfjs-node

> @tensorflow/tfjs-node@0.1.20 install C:\Users\jcruz\Documents\nodejs\node_modules\@tensorflow\tfjs-node
> node scripts/install.js

* Downloading libtensorflow
[==============================] 13622503/bps 98% 0.0s
* Building TensorFlow Node.js bindings
C:\Users\jcruz\Documents\nodejs\node_modules\@tensorflow\tfjs-node\scripts\install.js:154
      throw new Error('node-gyp rebuild failed with: ' + err);
      ^

Error: node-gyp rebuild failed with: Error: Command failed: node-gyp rebuild
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
gyp ERR! build error
gyp ERR! stack Error: `C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe\` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Users\jcruz\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\build.js:262:23)
gyp ERR! stack     at ChildProcess.emit (events.js:182:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:240:12)
gyp ERR! System Windows_NT 10.0.17134
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\jcruz\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\jcruz\Documents\nodejs\node_modules\@tensorflow\tfjs-node
gyp ERR! node -v v10.13.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok

    at cp.exec (C:\Users\jcruz\Documents\nodejs\node_modules\@tensorflow\tfjs-node\scripts\install.js:154:13)
    at ChildProcess.exithandler (child_process.js:296:5)
    at ChildProcess.emit (events.js:182:13)
    at maybeClose (internal/child_process.js:962:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:251:5)
npm WARN enoent ENOENT: no such file or directory, open 'C:\Users\jcruz\Documents\nodejs\package.json'
npm WARN nodejs No description
npm WARN nodejs No repository field.
npm WARN nodejs No README data
npm WARN nodejs No license field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @tensorflow/tfjs-node@0.1.20 install: `node scripts/install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @tensorflow/tfjs-node@0.1.20 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\jcruz\AppData\Roaming\npm-cache\_logs\2018-11-15T01_16_06_967Z-debug.log

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
kangyizhangcommented, Nov 20, 2018

hi @nightBaker

can you run npm install --production windows-build-tools and then try to install tfjs-node? I used to have a similar MSBUILD error and reinstall windows-build-tools resolved it.l

1reaction
bargainvideoscommented, Nov 15, 2018

@nkreeger, I took a look at https://github.com/nodejs/node-gyp/issues/119#issuecomment-331778053 and I think that solved my problem.

Though when I first tried to install the windows-build-tools package, I got an error because I didn’t run from an elevated Command Prompt. But when I opened a Command Prompt that had administrative privileges, the install went smoothly, albeit slowly (took about 5 minutes).

First I installed windows-build-tools:

C:\Users\jcruz\Documents\nodejs\demo>npm install --production windows-build-tools

> windows-build-tools@5.0.0 postinstall C:\Users\jcruz\Documents\nodejs\node_modules\windows-build-tools
> node ./dist/index.js

Downloading vs_BuildTools.exe
[>                                            ] 0.0% (0 B/s)
Downloaded vs_BuildTools.exe. Saved to C:\Users\jcruz\.windows-build-tools\vs_BuildTools.exe.

Starting installation...
Launched installers, now waiting for them to finish.
This will likely take some time - please be patient!

Status from the installers:
---------- Visual Studio Build Tools ----------
Successfully installed Visual Studio Build Tools.
------------------- Python --------------------
Python 2.7.15 is already installed, not installing again.

Now configuring the Visual Studio Build Tools..

All done!

npm WARN saveError ENOENT: no such file or directory, open 'C:\Users\jcruz\Documents\nodejs\package.json'
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN enoent ENOENT: no such file or directory, open 'C:\Users\jcruz\Documents\nodejs\package.json'
npm WARN nodejs No description
npm WARN nodejs No repository field.
npm WARN nodejs No README data
npm WARN nodejs No license field.

+ windows-build-tools@5.0.0
added 141 packages from 93 contributors and audited 248 packages in 282.687s
found 0 vulnerabilities

Then I installed @tensorflow/tfjs-node:

C:\Users\jcruz\Documents\nodejs\demo>npm install @tensorflow/tfjs-node

> @tensorflow/tfjs-node@0.1.20 install C:\Users\jcruz\Documents\nodejs\node_modules\@tensorflow\tfjs-node
> node scripts/install.js

* Downloading libtensorflow
[==============================] 11109995/bps 98% 0.0s
* Building TensorFlow Node.js bindings

> protobufjs@6.8.8 postinstall C:\Users\jcruz\Documents\nodejs\node_modules\protobufjs
> node scripts/postinstall

npm WARN saveError ENOENT: no such file or directory, open 'C:\Users\jcruz\Documents\nodejs\package.json'
npm WARN enoent ENOENT: no such file or directory, open 'C:\Users\jcruz\Documents\nodejs\package.json'
npm WARN nodejs No description
npm WARN nodejs No repository field.
npm WARN nodejs No README data
npm WARN nodejs No license field.

+ @tensorflow/tfjs-node@0.1.20
added 36 packages from 49 contributors and audited 1108 packages in 13.758s
found 0 vulnerabilities

Aside from some warnings, looks like I was finally able to install @tensorflow/tfjs-node!

Thanks much @nkreeger for the help!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to install @tensorflow/tfjs-node with npm
I tried installing 'node-pre-gyp' globally, with and without root permissions but no success.
Read more >
Installation of tensorflow/tfjs-node fails · Issue #6700 - GitHub
Installation of tensorflow/tfjs-node fails #6700​​ comp:node. js type:build/install Windows.
Read more >
@tensorflow/tfjs-node - npm
This repository provides native TensorFlow execution in backend JavaScript applications under the Node.js runtime, accelerated by the ...
Read more >
Unable to install @tensorflow/tfjs-node - General
Hi, I am a beginner to node-red. I have been trying to install the @tensorflow/tfjs-node to node-red. In Winodws cmd and node-red on...
Read more >
Installation error for tfjs-node on raspberry pi 3
Hello,. I'm unable to install tensorflowjs for node on raspberry pi. ... npm rebuild @tensorflow/tfjs-node .... gyp verb node dev dir /home/pi/.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found