askmike / gekko

A bitcoin trading bot written in node - https://gekko.wizb.it/
MIT License
10.05k stars 3.95k forks source link

Join is not a function (Missing exchanges and other default data in UI) #2685

Closed ducho closed 5 years ago

ducho commented 5 years ago

I'm submitting a ... [x] bug report [ ] question about the decisions made in the repository

Action taken (what you did) I tried to run UI and configure API key

Expected result (what you hoped would happen) Drop down menus would appear for exchanges

Actual result (unexpected outcome) No options for select box 'Exchanges'

screen shot 2018-12-19 at 09 59 43

Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, etc) MacOS High Sierra 10.13.6 node v11.5.0

> sqlite3@4.0.4 install /Users/ducho/Sites/gekko/node_modules/sqlite3
> node-pre-gyp install --fallback-to-build

node-pre-gyp WARN Using request for node-pre-gyp https download 
[sqlite3] Success: "/Users/ducho/Sites/gekko/node_modules/sqlite3/lib/binding/node-v67-darwin-x64/node_sqlite3.node" is installed via remote
added 213 packages from 175 contributors and audited 520 packages in 7.38s
found 1 low severity vulnerability
  run `npm audit fix` to fix them, or `npm audit` for details
DSs-MacBook-Pro:gekko ducho$ npm audit fix

> sinon@4.5.0 postinstall /Users/ducho/Sites/gekko/node_modules/sinon
> node scripts/support-sinon.js

Have some ❤️ for Sinon? You can support the project via Open Collective:
 > https://opencollective.com/sinon/donate

added 31 packages from 747 contributors in 3.304s
fixed 0 of 1 vulnerability in 520 scanned packages
  1 package update for 1 vuln involved breaking changes
  (use `npm audit fix --force` to install breaking changes; or refer to `npm audit` for steps to fix these manually)
DSs-MacBook-Pro:gekko ducho$ npm audit fix --force
npm WARN using --force I sure hope you know what you are doing.
+ lodash@4.17.11
updated 1 package in 1.962s
fixed 1 of 1 vulnerability in 520 scanned packages
  1 package update for 1 vuln involved breaking changes
  (installed due to `--force` option)
DSs-MacBook-Pro:gekko ducho$ cd exchange/
DSs-MacBook-Pro:exchange ducho$ npm install --only=production

> websocket@1.0.26 install /Users/ducho/Sites/gekko/exchange/node_modules/websocket
> (node-gyp rebuild 2> builderror.log) || (exit 0)

  CXX(target) Release/obj.target/bufferutil/src/bufferutil.o
  SOLINK_MODULE(target) Release/bufferutil.node
  CXX(target) Release/obj.target/validation/src/validation.o
  SOLINK_MODULE(target) Release/validation.node
added 115 packages from 165 contributors and audited 400 packages in 11.363s
found 0 vulnerabilities

I thinkg the problem is that lodash package not working.


  TypeError: _.last(...).join is not a function
      at exchangesDir.filter.f (/Users/ducho/Sites/gekko/web/routes/exchanges.js:17:31)
      at Array.filter (<anonymous>)
      at Object.module.exports (/Users/ducho/Sites/gekko/web/routes/exchanges.js:17:6)
      at module.exports.next (<anonymous>)
      at Object.dispatch (/Users/ducho/Sites/gekko/node_modules/koa-router/lib/router.js:334:5)
      at dispatch.next (<anonymous>)
      at onFulfilled (/Users/ducho/Sites/gekko/node_modules/co/index.js:65:19)
image

console.log(exchangesDir);

[ 'DEBUG_exchange-simulator.js',
  'binance-markets.json',
  'binance.js',
  'bitcoin-co-id.js.old',
  'bitfinex-markets.json',
  'bitfinex.js',
  'bitfinex_v2.js.prep',
  'bitstamp.js.old',
  'bittrex.js',
  'btc-markets.js.old',
  'btcc.js.old',
  'bx.in.th.js.old',
  'cexio.js.old',
  'coinbase-markets.json',
  'coinfalcon-markets.json',
  'coinfalcon.js',
  'coingi.js',
  'exmo-markets.json',
  'exmo.js',
  'gdax.js',
  'gemini.js.old',
  'kraken-markets.json',
  'kraken.js',
  'lakebtc.js',
  'luno.js',
  'mexbt.js.old',
  'mtgox.js.old',
  'okcoin.js.old',
  'poloniex-markets.json',
  'poloniex.js',
  'quadriga-markets.json',
  'quadriga.js.old',
  'wex.nz.js.old',
  'zaif.jp.js.old' ]
ducho commented 5 years ago

Do not run npm audit fix because it updates lodash to newest version 4.17