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

Unable to install @tensorflow/tfjs-node #911

Closed
bargainvideos opened this issue Nov 15, 2018 · 9 comments
Closed

Unable to install @tensorflow/tfjs-node #911

bargainvideos opened this issue Nov 15, 2018 · 9 comments

Comments

@bargainvideos
Copy link

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
@nkreeger
Copy link
Contributor

Thanks for the report - couple of things to look at:

1.) Can you post: C:\Users\jcruz\AppData\Roaming\npm-cache_logs\2018-11-15T01_16_06_967Z-debug.log

2.) It looks like NPM is using your global version of node-gyp - can we check the version ? Looking at this line:

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"

Also this might help - nodejs/node-gyp#119 (comment)

Let me know and I can add that to our README

@bargainvideos
Copy link
Author

@nkreeger here is the information you requested:

1.) 2018-11-15T01_16_06_967Z-debug.log

2.) Looks like I'm running version 3.8.0 of node-gyp

C:\Users\jcruz\Documents\nodejs\demo>npm show node-gyp version
3.8.0

I'll take a look at node-gyp issue 119 that you mentioned and see if there's anything there that will help fix my problem. Thanks for giving me some direction!

@bargainvideos
Copy link
Author

@nkreeger, I took a look at nodejs/node-gyp#119 (comment) 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!

@ttfreeman
Copy link

Not working. I tried all the steps above and still get the same error.

@kangyizhang
Copy link
Contributor

Hi @ttfreeman

Is your error similar to this
'stack Error: C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe\ failed with exit code: 1'?

@nightBaker
Copy link

@kangyizhang, I have bit different error

gyp ERR! stack Error: C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe failed with exit code: 1

@ttfreeman
Copy link

@kangyizhang, the complete log attached:

2018-11-20T15_54_56_291Z-debug.log

@kangyizhang
Copy link
Contributor

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

@ttfreeman
Copy link

My issue is resolved by following the steps posted by user 'refack' in the following thread: nodejs/node-gyp#1144

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

6 participants