ctubio / tribeca

Self-hosted crypto trading bot (automated high frequency market making) in node.js, angular, typescript and c++
https://127.0.0.1:3000
Other
95 stars 26 forks source link

Could not locate the bindings file #94

Closed jangrewe closed 7 years ago

jangrewe commented 7 years ago

Since a day or two, i keep getting this error when updating via npm run latest:

> tribeca@2.0.0 latest /opt/tribeca
> _() { git rev-parse $1; }; npm run diff && test `_ @` != `_ @{u}` && npm run reinstall || echo Already running latest `_ @{u}` version!

> tribeca@2.0.0 diff /opt/tribeca
> _() { echo $2 $3 version: `git rev-parse $1`; }; git remote update && _ @ Local running && _ @{u} Latest remote && npm run changelog

Fetching origin
Local running version: 2f8c29c83a75a23d999c49f341ee32eeac286909
Latest remote version: d7782241d74b3bea2aa8ea55d2e4eafccee16eac

> tribeca@2.0.0 changelog /opt/tribeca
> git --no-pager log --graph --oneline @..@{u}

* d778224 (origin/master, origin/HEAD) Updated unreleased notes.
* e67528c Updated source without useless conditions.
* 359e015 Fixed Bitfinex price precision to resolve #84.
* ec10b13 Fixed Coinbase app crash when cancelAllOrders returns non 200 status.
* 205d3d2 Updated test timeout for travis.
* 394b7e7 Added benchmark test unit for STDEV C++ binding.

> tribeca@2.0.0 reinstall /opt/tribeca
> rm -rf app && git fetch && git merge FETCH_HEAD && npm install && npm run test && forever restartall

Updating 2f8c29c..d778224
Fast-forward
 README.md                         |  4 +++-
 binding.gyp                       |  3 ++-
 npm-shrinkwrap.json               | 12 ++++++++++++
 package.json                      |  5 +++--
 src/lib/round.cc                  | 35 ++++-------------------------------
 src/lib/round.h                   |  2 --
 src/lib/stdev.cc                  | 42 ++++++++++++++++++++++++++++++++++++++++++
 src/lib/stdev.h                   | 23 +++++++++++++++++++++++
 src/lib/tribeca.cc                |  4 +++-
 src/server/broker.ts              |  3 +--
 src/server/fair-value.ts          |  3 +--
 src/server/gateways/bitfinex.ts   |  3 ++-
 src/server/gateways/coinbase.ts   |  3 +--
 src/server/gateways/nullgw.ts     |  3 +--
 src/server/main.ts                |  3 +--
 src/server/position-management.ts | 25 ++++++++++++-------------
 src/server/quoter.ts              |  4 ++--
 src/server/quoting-engine.ts      |  9 ++++-----
 src/server/statistics.ts          | 50 +++++++++++++++++++++++++-------------------------
 src/server/utils.ts               | 22 ++++++++++++++++++++++
 test/benchmark.ts                 | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 21 files changed, 232 insertions(+), 94 deletions(-)
 create mode 100644 src/lib/stdev.cc
 create mode 100644 src/lib/stdev.h
 create mode 100644 test/benchmark.ts
npm WARN lifecycle tribeca@2.0.0~install: cannot run in wd %s %s (wd=%s) tribeca@2.0.0 node-gyp rebuild /opt/tribeca
npm WARN lifecycle tribeca@2.0.0~postinstall: cannot run in wd %s %s (wd=%s) tribeca@2.0.0 npm run compile-server && npm run compile-client && npm run compile-public && npm run compile-bundle /opt/tribeca
- ncp@2.0.0 node_modules/ncp
- @types/bunyan@0.0.36 node_modules/@types/bunyan
- dtrace-provider@0.8.1 node_modules/dtrace-provider
- mv@2.1.1 node_modules/mv
- safe-json-stringify@1.0.4 node_modules/safe-json-stringify
- bunyan@1.8.10 node_modules/bunyan
tribeca@2.0.0 /opt/tribeca
├── benchmark@2.1.4
├── bindings@1.2.1
└── platform@1.3.4

> tribeca@2.0.0 test /opt/tribeca
> mocha --timeout 42000 --compilers ts:ts-node/register test/*.ts

/opt/tribeca/node_modules/bindings/bindings.js:88
  err = new Error('Could not locate the bindings file. Tried:\n'
        ^
Error: Could not locate the bindings file. Tried:
 → /opt/tribeca/build/tribeca.node
 → /opt/tribeca/build/Debug/tribeca.node
 → /opt/tribeca/build/Release/tribeca.node
 → /opt/tribeca/out/Debug/tribeca.node
 → /opt/tribeca/Debug/tribeca.node
 → /opt/tribeca/out/Release/tribeca.node
 → /opt/tribeca/Release/tribeca.node
 → /opt/tribeca/build/default/tribeca.node
 → /opt/tribeca/compiled/7.10.0/linux/x64/tribeca.node
    at bindings (/opt/tribeca/node_modules/bindings/bindings.js:88:9)
    at Object.<anonymous> (/opt/tribeca/test/benchmark.ts:4:35)
    at Module._compile (module.js:571:32)
    at Module.m._compile (/opt/tribeca/node_modules/ts-node/src/index.ts:385:23)
    at Module._extensions..js (module.js:580:10)
    at Object.require.extensions.(anonymous function) [as .ts] (/opt/tribeca/node_modules/ts-node/src/index.ts:388:12)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
    at /opt/tribeca/node_modules/mocha/lib/mocha.js:230:27
    at Array.forEach (native)
    at Mocha.loadFiles (/opt/tribeca/node_modules/mocha/lib/mocha.js:227:14)
    at Mocha.run (/opt/tribeca/node_modules/mocha/lib/mocha.js:495:10)
    at Object.<anonymous> (/opt/tribeca/node_modules/mocha/bin/_mocha:469:18)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.runMain (module.js:605:10)
    at run (bootstrap_node.js:427:7)
    at startup (bootstrap_node.js:151:9)
    at bootstrap_node.js:542:3

npm ERR! Linux 4.9.0-2-amd64
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "run" "test"
npm ERR! node v7.10.0
npm ERR! npm  v4.2.0
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! tribeca@2.0.0 test: `mocha --timeout 42000 --compilers ts:ts-node/register test/*.ts`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the tribeca@2.0.0 test script 'mocha --timeout 42000 --compilers ts:ts-node/register test/*.ts'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the tribeca package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     mocha --timeout 42000 --compilers ts:ts-node/register test/*.ts
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs tribeca
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls tribeca
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /root/.npm/_logs/2017-05-23T05_01_55_634Z-debug.log

npm ERR! Linux 4.9.0-2-amd64
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "run" "reinstall"
npm ERR! node v7.10.0
npm ERR! npm  v4.2.0
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! tribeca@2.0.0 reinstall: `rm -rf app && git fetch && git merge FETCH_HEAD && npm install && npm run test && forever restartall`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the tribeca@2.0.0 reinstall script 'rm -rf app && git fetch && git merge FETCH_HEAD && npm install && npm run test && forever restartall'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the tribeca package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     rm -rf app && git fetch && git merge FETCH_HEAD && npm install && npm run test && forever restartall
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs tribeca
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls tribeca
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /root/.npm/_logs/2017-05-23T05_01_55_662Z-debug.log
zachaller commented 7 years ago

Try not running as root I think node-gyp has some safty checks or something built in so that it dose not like building as root

ctubio commented 7 years ago

~i will try to handle this situation in a nicer way but meanwhile~ the best solution is the hint of @zachaller

ctubio commented 7 years ago

npm parameter --unsafe-perm may fix this issue (see a working example installing with root at https://github.com/ctubio/tribeca/blob/master/dist/Dockerfile#L14), but i would not recommend to use root user (in the same way that Docker installation is also not the recommended one).

While using npm run latest, npm does not uses --unsafe-perm and is not planned to be used.

jangrewe commented 7 years ago

Thanks, i'm running it as a user now.