question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. Itย collects links to all the places you might be looking at while hunting down a tough bug.

And, if youโ€™re still stuck at the end, weโ€™re happy to hop on a call to see how we can help out.

recipe for target 'Release/libtensorflow.so' failed when installing `tfjs-node`

See original GitHub issue

TensorFlow.js version

@tensorflow/tfjs-node - 0.1.8

Browser version

N/A

Linux version

$ uname -a
Linux hostname 4.15.0-23-generic #25-Ubuntu SMP Wed May 23 18:02:16 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 18.04 LTS
Release:	18.04
Codename:	bionic

Describe the problem or feature request

Whenever I try to install @tensorflow/tfjs-node, node-gyp exits with code 1.

Code to reproduce the bug / link to feature request

$ yarn add @tensorflow/tfjs @tensorflow/tfjs-node
yarn add v1.7.0
info No lockfile found.
[1/4] Resolving packages...
โ  (node:32362) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
[2/4] Fetching packages...
[3/4] Linking dependencies...
warning " > @tensorflow/tfjs-node@0.1.8" has unmet peer dependency "@tensorflow/tfjs-core@~0.12.1".
[4/4] Building fresh packages...
[1/2] โ   protobufjs
error ~/playground/tensorflowjs_tmp/node_modules/@tensorflow/tfjs-node: Command failed.
Exit code: 1
Command: node-gyp rebuild
Arguments:
Directory: ~/playground/tensorflowjs_tmp/node_modules/@tensorflow/tfjs-node
Output:
gyp info it worked if it ends with ok
gyp info using node-gyp@3.6.2
gyp info using node@10.6.0 | linux | x64
gyp info spawn /usr/bin/python2
gyp info spawn args [ '~/.nvm/versions/node/v10.6.0/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'make',
gyp info spawn args   '-I',
gyp info spawn args   '~/playground/tensorflowjs_tmp/node_modules/@tensorflow/tfjs-node/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '~/.nvm/versions/node/v10.6.0/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '~/.node-gyp/10.6.0/include/node/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=~/.node-gyp/10.6.0',
gyp info spawn args   '-Dnode_gyp_dir=~/.nvm/versions/node/v10.6.0/lib/node_modules/npm/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=~/.node-gyp/10.6.0/<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=~/playground/tensorflowjs_tmp/node_modules/@tensorflow/tfjs-node',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'build',
gyp info spawn args   '-Goutput_dir=.' ]
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
make: Entering directory '~/playground/tensorflowjs_tmp/node_modules/@tensorflow/tfjs-node/build'
  ACTION binding_gyp_tfjs_binding_target_download_libtensorflow Release/libtensorflow.so
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 14.0M  100 14.0M    0     0   178k      0  0:01:20  0:01:20 --:--:--  173k

gzip: stdin: unexpected end of file
tar: Child returned status 1
tar: Error is not recoverable: exiting now
tfjs_binding.target.mk:13: recipe for target 'Release/libtensorflow.so' failed
make: Leaving directory '~/playground/tensorflowjs_tmp/node_modules/@tensorflow/tfjs-node/build'
make: *** [Release/libtensorflow.so] Error 2
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (~/.nvm/versions/node/v10.6.0/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:258:23)
gyp ERR! stack     at ChildProcess.emit (events.js:182:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:237:12)
gyp ERR! System Linux 4.15.0-23-generic
gyp ERR! command "~/.nvm/versions/node/v10.6.0/bin/node" "~/.nvm/versions/node/v10.6.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd ~/playground/tensorflowjs_tmp/node_modules/@tensorflow/tfjs-node
gyp ERR! node -v v10.6.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok

I tried with the LTS (8.11.3) version of Node, and get the same error:

$ yarn add @tensorflow/tfjs @tensorflow/tfjs-node
yarn add v1.7.0
info No lockfile found.
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
warning " > @tensorflow/tfjs-node@0.1.8" has unmet peer dependency "@tensorflow/tfjs-core@~0.12.1".
[4/4] Building fresh packages...
[1/2] โก€ protobufjs
error ~/playground/tensorflowjs_tmp/node_modules/@tensorflow/tfjs-node: Command failed.
Exit code: 1
Command: node-gyp rebuild
Arguments:
Directory: ~/playground/tensorflowjs_tmp/node_modules/@tensorflow/tfjs-node
Output:
gyp info it worked if it ends with ok
gyp info using node-gyp@3.6.2
gyp info using node@8.11.3 | linux | x64
gyp http GET https://nodejs.org/download/release/v8.11.3/node-v8.11.3-headers.tar.gz
gyp http 200 https://nodejs.org/download/release/v8.11.3/node-v8.11.3-headers.tar.gz
gyp http GET https://nodejs.org/download/release/v8.11.3/SHASUMS256.txt
gyp http 200 https://nodejs.org/download/release/v8.11.3/SHASUMS256.txt
gyp info spawn /usr/bin/python2
gyp info spawn args [ '~/.nvm/versions/node/v8.11.3/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'make',
gyp info spawn args   '-I',
gyp info spawn args   '~/playground/tensorflowjs_tmp/node_modules/@tensorflow/tfjs-node/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '~/.nvm/versions/node/v8.11.3/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '~/.node-gyp/8.11.3/include/node/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=~/.node-gyp/8.11.3',
gyp info spawn args   '-Dnode_gyp_dir=~/.nvm/versions/node/v8.11.3/lib/node_modules/npm/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=~/.node-gyp/8.11.3/<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=~/playground/tensorflowjs_tmp/node_modules/@tensorflow/tfjs-node',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'build',
gyp info spawn args   '-Goutput_dir=.' ]
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
make: Entering directory '~/playground/tensorflowjs_tmp/node_modules/@tensorflow/tfjs-node/build'
  ACTION binding_gyp_tfjs_binding_target_download_libtensorflow Release/libtensorflow.so
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 14.0M  100 14.0M    0     0   224k      0  0:01:03  0:01:03 --:--:--  360k

gzip: stdin: unexpected end of file
tar: Child returned status 1
tar: Error is not recoverable: exiting now
tfjs_binding.target.mk:13: recipe for target 'Release/libtensorflow.so' failed
make: Leaving directory '~/playground/tensorflowjs_tmp/node_modules/@tensorflow/tfjs-node/build'
make: *** [Release/libtensorflow.so] Error 2
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (~/.nvm/versions/node/v8.11.3/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:258:23)
gyp ERR! stack     at emitTwo (events.js:126:13)
gyp ERR! stack     at ChildProcess.emit (events.js:214:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Linux 4.15.0-23-generic
gyp ERR! command "~/.nvm/versions/node/v8.11.3/bin/node" "~/.nvm/versions/node/v8.11.3/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd ~/playground/tensorflowjs_tmp/node_modules/@tensorflow/tfjs-node
gyp ERR! node -v v8.11.3
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
nkreegercommented, Jul 14, 2018

Actually - just published 0.1.9 since we had one small fix queued.

0reactions
d4nyllcommented, Jul 14, 2018

@nkreeger Thanks for your quick response. Just to confirm, I am now using tfjs-node v0.1.9 and itโ€™s working like a charm!

$ yarn add @tensorflow/tfjs @tensorflow/tfjs-node
yarn add v1.7.0
info No lockfile found.
(node:29358) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
warning " > @tensorflow/tfjs-node@0.1.9" has unmet peer dependency "@tensorflow/tfjs-core@~0.12.1".
[4/4] Building fresh packages...
success Saved lockfile.
success Saved 23 new dependencies.
info Direct dependencies
โ”œโ”€ @tensorflow/tfjs-node@0.1.9
โ””โ”€ @tensorflow/tfjs@0.12.2
info All dependencies
โ”œโ”€ @protobufjs/aspromise@1.1.2
โ”œโ”€ @protobufjs/base64@1.1.2
โ”œโ”€ @protobufjs/codegen@2.0.4
โ”œโ”€ @protobufjs/eventemitter@1.1.0
โ”œโ”€ @protobufjs/fetch@1.1.0
โ”œโ”€ @protobufjs/float@1.0.2
โ”œโ”€ @protobufjs/path@1.1.2
โ”œโ”€ @protobufjs/pool@1.1.0
โ”œโ”€ @protobufjs/utf8@1.1.0
โ”œโ”€ @tensorflow/tfjs-converter@0.5.1
โ”œโ”€ @tensorflow/tfjs-core@0.12.4
โ”œโ”€ @tensorflow/tfjs-layers@0.7.0
โ”œโ”€ @tensorflow/tfjs-node@0.1.9
โ”œโ”€ @tensorflow/tfjs@0.12.2
โ”œโ”€ @types/long@3.0.32
โ”œโ”€ @types/node@8.10.21
โ”œโ”€ bindings@1.3.0
โ”œโ”€ long@4.0.0
โ”œโ”€ protobufjs@6.8.6
โ”œโ”€ punycode@1.3.2
โ”œโ”€ querystring@0.2.0
โ”œโ”€ seedrandom@2.4.3
โ””โ”€ url@0.11.0
Done in 11.69s.
Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to "npm install @tensorflow/tfjs-node" - Stack Overflow
Finally, i can run TensorFlow.js Node sample on Windows. Indeed, it runs on Ubuntu WSL (Windows Subsystem for Linux).
Read more >
Npm NodeJS Installe node-gyp rebuild error "libtensorflow.so
From looking at the logs in the console it seems that Tensorflow.js Node when it's installing and runs node-gyp rebuild it get's an...
Read more >
Setup | TensorFlow.js
Option 1: Install TensorFlow.js with native C++ bindings. tfjs-node ยท Option 2: (Linux Only) If your system has a NVIDIAยฎ GPU with CUDA...
Read more >
@tensorflow/tfjs - npm
Use flexible and intuitive APIs to build models from scratch using the low-level JavaScript linear algebra library or the high-level layers API.
Read more >
node-red-contrib-tf-model 0.1.10
This module requires @tensorflow/tfjs-node as a peer dependency. ... You will see an error message while downloading/installing/compiling the sharedย ...
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