0

I have a NodeJS project that is using danfojs-node and @tensorflow/tfjs-node on node version 14.20.1.

The project is able to run successfully on Mac OS, but when I try to deploy to a development environment in Cloud Foundry, it bombs out with the following error:

* Building TensorFlow Node.js bindings
OUT node-pre-gyp install failed with error: Error: Command failed: node-pre-gyp install --fallback-to-build
OUT npm ERR!     /home/vcap/.npm/_logs/2023-01-16T19_49_09_545Z-debug.log
OUT internal/modules/cjs/loader.js:905
OUT   throw err;
OUT   ^
OUT Error: Cannot find module '../lib/main'
OUT Require stack:
OUT - /tmp/app/node_modules/@tensorflow/tfjs-node/node_modules/.bin/node-pre-gyp
OUT     at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15)
OUT     at Function.Module._load (internal/modules/cjs/loader.js:746:27)
OUT     at Module.require (internal/modules/cjs/loader.js:974:19)
OUT     at require (internal/modules/cjs/helpers.js:101:18)
OUT     at Object.<anonymous> (/tmp/app/node_modules/@tensorflow/tfjs-node/node_modules/.bin/node-pre-gyp:4:1)
OUT     at Module._compile (internal/modules/cjs/loader.js:1085:14)
OUT     at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
OUT     at Module.load (internal/modules/cjs/loader.js:950:32)
OUT     at Function.Module._load (internal/modules/cjs/loader.js:790:12)
OUT     at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:75:12) {
OUT   code: 'MODULE_NOT_FOUND',
OUT   requireStack: [
OUT     '/tmp/app/node_modules/@tensorflow/tfjs-node/node_modules/.bin/node-pre-gyp'
OUT   ]
OUT }
OUT npm ERR! code ELIFECYCLE
OUT npm ERR! errno 1
OUT npm ERR! @tensorflow/tfjs-node@3.13.0 install: `node scripts/install.js`
OUT npm ERR! Exit status 1
OUT npm ERR! 
OUT npm ERR! Failed at the @tensorflow/tfjs-node@3.13.0 install script.
OUT npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
OUT npm ERR! A complete log of this run can be found in:
OUT        **ERROR** Unable to build dependencies: exit status 1
OUT        **WARNING** A module may be missing from 'dependencies' in package.json
OUT        This module may be specified in 'devDependencies' instead of 'dependencies'
OUT        See: https://devcenter.heroku.com/articles/nodejs-support#devdependencies
ERR Failed to compile droplet: Failed to run all supply scripts: exit status 14
OUT Exit status 223

We've tried every conceivable combination of node & tensorflowjs/tfjs-node versions, and we've also tried adding @mapbox/node-pre-gyp to the dependencies in package.json. This current iteration is using tfjs-node@3.13.0.

This particular iteration had @tensorflow/tfjs-node in devDependencies as well, but we're receiving this error regardless of whether or not we include the package there.

We've also tried adding tensorflow/tfjs-node preinstall scripts w/ the --ignore-scripts flag and post-install scripts with the --build-addon-from-source flag in package.json, but to no avail.

Again, everything works great locally (famous last words) with a simple npm install.

Apologies if there's not enough info here -- I'm very green at this -- but this has been weeks of failure and would really appreciate any help!

0 Answers0