This could very well be user error but it would be great if someone could either validate that something has gone terribly wrong or not.
Using proxmox container image: ubuntu-20.04-standard_20.04-1_amd64.tar.gz
Steps:
apt update && apt dist-upgrade
apt install nodejs npm
At this point here are my versions:
python2 --version // Python 2.7.18rc1
python3 --version // Python 3.8.2
nodejs --version // v10.19.0
npm --version // 6.14.4
Now time for the fireworks.
npm install danfojs-node
> @tensorflow/[email protected] install /root/node_modules/@tensorflow/tfjs-node
> node scripts/install.js
CPU-linux-2.1.0.tar.gz
* Downloading libtensorflow
[==============================] 2774145/bps 100% 0.0s
* Building TensorFlow Node.js bindings
> [email protected] postinstall /root/node_modules/core-js
> node -e "try{require('./postinstall')}catch(e){}"
Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!
The project needs your help! Please consider supporting of core-js on Open Collective or Patreon:
> https://opencollective.com/core-js
> https://www.patreon.com/zloirock
Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)
npm WARN saveError ENOENT: no such file or directory, open '/root/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 '/root/package.json'
npm WARN @tensorflow/[email protected] requires a peer of @tensorflow/[email protected] but none is installed. You must install peer dependencies yourself.
npm WARN @tensorflow/[email protected] requires a peer of @tensorflow/[email protected] but none is installed. You must install peer dependencies yourself.
npm WARN @tensorflow/[email protected] requires a peer of @tensorflow/[email protected] but none is installed. You must install peer dependencies yourself.
npm WARN @tensorflow/[email protected] requires a peer of @tensorflow/[email protected] but none is installed. You must install peer dependencies yourself.
npm WARN @tensorflow/[email protected] requires a peer of @tensorflow/[email protected] but none is installed. You must install peer dependencies yourself.
npm WARN root No description
npm WARN root No repository field.
npm WARN root No README data
npm WARN root No license field.
+ [email protected]
added 128 packages from 121 contributors and audited 128 packages in 83.191s
3 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
npm init -y
index.js:
console.log("before");
const dfd = require("danfojs-node");
console.log("after");
root@tensor3:~# node index.js
before
Platform node has already been set. Overwriting the platform with [object Object].
Platform node has already been set. Overwriting the platform with [object Object].
node-pre-gyp info This Node instance does not support builds for N-API version 6
node-pre-gyp info This Node instance does not support builds for N-API version 6
Illegal instruction
For fun:
npm install @tensorflow/[email protected] @tensorflow/[email protected] @tensorflow/[email protected] @tensorflow/[email protected] @tensorflow/[email protected] @tensorflow/[email protected]
Packages installed fine. Same result.
nano node_modules/danfojs-node/dist/index.js
console.log('series danfo'); // This logs
var _series = require("./core/series");
console.log('frame danfo'); // This does not
var _frame = require("./core/frame");
nano node_modules/danfojs-node/dist/core/series.js
console.log('tf'); // This logs
var tf = _interopRequireWildcard(require("@tensorflow/tfjs-node"));
console.log('mathjs'); // This does not
Uh oh, seems to be a tensorflow issue.
I kept going down the rabbit hole and because I don't know how to use a debugger on the node side, it was painful.
nano node_modules/@tensorflow/tfjs-node/dist/index.js
It fails on this line: var bindings = require(bindingPath);
bindingPath is defined as:
var bindingPath = binary.find(path.resolve(path.join(__dirname, '/../package.json')));
logging bindingPath:
/root/node_modules/@tensorflow/tfjs-node/lib/napi-v5/tfjs_binding.node
Aha!
npm install @tensorflow/tfjs-node
Then I installed nvm and node v14.9.0
npm rebuild @tensorflow/tfjs-node build-addon-from-source
Now my index.js consists only of:
import * as tf from '@tensorflow/tfjs-node';
And I'm still getting that ILLEGAL INSTRUCTION. Clearly not a danfo issue, but still hoping someone here can point me in the right direction.