Open Poilaucul opened 5 years ago
Greetings,
you may update:
const config = require("../src/config");
to:
const config = require("../src/config/index.example.js");
in the following files:
backend/restProxy.js
backend/websocket.js
And
import { httpProxyPort } from "config";
to:
import { httpProxyPort } from "config/index.example.js";
in the following files:
src/modules/api/BitmexFetch.js
src/modules/data/DataProvider.js
Best Regards, Ahmed
Hi,
Thanks, this is what I get now:
root@andromeda:/home/desktop/bitmex-scaled-orders# npm install
> uglifyjs-webpack-plugin@0.4.6 postinstall /home/desktop/bitmex-scaled-orders/node_modules/uglifyjs-webpack-plugin
> node lib/post_install.js
> nodemon@1.17.5 postinstall /home/desktop/bitmex-scaled-orders/node_modules/nodemon
> node bin/postinstall || exit 0
Love nodemon? You can now support the project via the open collective:
> https://opencollective.com/nodemon/donate
> styled-components@3.4.2 postinstall /home/desktop/bitmex-scaled-orders/node_modules/styled-components
> node ./scripts/postinstall.js || exit 0
Use styled-components at work? Consider supporting our development efforts at opencollective.com/styled-components
npm WARN lifecycle bmex-orderer@0.6.2~postinstall: cannot run in wd bmex-orderer@0.6.2 node postinstall.js (wd=/home/desktop/bitmex-scaled-orders)
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
added 1417 packages from 848 contributors and audited 16090 packages in 31.939s
found 5 vulnerabilities (2 low, 3 high)
run `npm audit fix` to fix them, or `npm audit` for details
╭───────────────────────────────────────────────────────────────╮
│ │
│ New minor version of npm available! 6.5.0 → 6.7.0 │
│ Changelog: https://github.com/npm/cli/releases/tag/v6.7.0 │
│ Run npm install -g npm to update! │
│ │
╰───────────────────────────────────────────────────────────────╯
root@andromeda:/home/desktop/bitmex-scaled-orders# npm run startup
> bmex-orderer@0.6.2 startup /home/desktop/bitmex-scaled-orders
> concurrently --allow-restart "npm:proxy" "npm:start"
[proxy]
[proxy] > bmex-orderer@0.6.2 proxy /home/desktop/bitmex-scaled-orders
[proxy] > node backend/proxy.js
[proxy]
[start]
[start] > bmex-orderer@0.6.2 start /home/desktop/bitmex-scaled-orders
[start] > react-scripts start
[start]
[proxy] Started webocket server on port 1337
[proxy] Started BitMEX proxy on port 8000
[start] Starting the development server...
[start]
[start] Failed to compile.
[start]
[start] ./src/App.js
[start] Module not found: Can't resolve 'containers/Dashboard' in '/home/desktop/bitmex-scaled-orders/src'
[start] Compiling...
[start] Failed to compile.
[start]
[start] ./src/App.js
[start] Module not found: Can't resolve 'containers/Dashboard' in '/home/desktop/bitmex-scaled-orders/src'
[proxy] internal/crypto/keys.js:279
[proxy] throw new ERR_INVALID_ARG_TYPE(
[proxy] ^
[proxy]
[proxy] TypeError [ERR_INVALID_ARG_TYPE]: The "key" argument must be one of type Buffer, TypedArray, DataView, string, or KeyObject. Received type undefined
[proxy] at prepareSecretKey (internal/crypto/keys.js:279:13)
[proxy] at new Hmac (internal/crypto/hash.js:95:9)
[proxy] at Object.createHmac (crypto.js:137:10)
[proxy] at createBitmexSignature (/home/desktop/bitmex-scaled-orders/backend/restProxy.js:25:6)
[proxy] at ProxyServer.<anonymous> (/home/desktop/bitmex-scaled-orders/backend/restProxy.js:45:36)
[proxy] at ProxyServer.emit (/home/desktop/bitmex-scaled-orders/node_modules/eventemitter3/index.js:119:35)
[proxy] at ClientRequest.<anonymous> (/home/desktop/bitmex-scaled-orders/node_modules/http-proxy/lib/http-proxy/passes/web-incoming.js:125:27)
[proxy] at ClientRequest.emit (events.js:202:15)
[proxy] at tickOnSocket (_http_client.js:661:7)
[proxy] at onSocketNT (_http_client.js:700:5)
[proxy] npm ERR! code ELIFECYCLE
[proxy] npm ERR! errno 1
[proxy] npm ERR! bmex-orderer@0.6.2 proxy: `node backend/proxy.js`
[proxy] npm ERR! Exit status 1
[proxy] npm ERR!
[proxy] npm ERR! Failed at the bmex-orderer@0.6.2 proxy script.
[proxy] npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
[proxy]
[proxy] npm ERR! A complete log of this run can be found in:
[proxy] npm ERR! /root/.npm/_logs/2019-02-07T23_05_05_934Z-debug.log
[proxy] npm run proxy exited with code 1
[proxy] npm run proxy restarted
[proxy]
[proxy] > bmex-orderer@0.6.2 proxy /home/desktop/bitmex-scaled-orders
[proxy] > node backend/proxy.js
[proxy]
[proxy] Started webocket server on port 1337
[proxy] Started BitMEX proxy on port 8000
[proxy] internal/crypto/keys.js:279
[proxy] throw new ERR_INVALID_ARG_TYPE(
[proxy] ^
[proxy]
[proxy] TypeError [ERR_INVALID_ARG_TYPE]: The "key" argument must be one of type Buffer, TypedArray, DataView, string, or KeyObject. Received type undefined
[proxy] at prepareSecretKey (internal/crypto/keys.js:279:13)
[proxy] at new Hmac (internal/crypto/hash.js:95:9)
[proxy] at Object.createHmac (crypto.js:137:10)
[proxy] at createBitmexSignature (/home/desktop/bitmex-scaled-orders/backend/restProxy.js:25:6)
[proxy] at ProxyServer.<anonymous> (/home/desktop/bitmex-scaled-orders/backend/restProxy.js:45:36)
[proxy] at ProxyServer.emit (/home/desktop/bitmex-scaled-orders/node_modules/eventemitter3/index.js:119:35)
[proxy] at ClientRequest.<anonymous> (/home/desktop/bitmex-scaled-orders/node_modules/http-proxy/lib/http-proxy/passes/web-incoming.js:125:27)
[proxy] at ClientRequest.emit (events.js:202:15)
[proxy] at tickOnSocket (_http_client.js:661:7)
[proxy] at onSocketNT (_http_client.js:700:5)
[proxy] npm ERR! code ELIFECYCLE
[proxy] npm ERR! errno 1
[proxy] npm ERR! bmex-orderer@0.6.2 proxy: `node backend/proxy.js`
[proxy] npm ERR! Exit status 1
[proxy] npm ERR!
[proxy] npm ERR! Failed at the bmex-orderer@0.6.2 proxy script.
[proxy] npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
[proxy]
[proxy] npm ERR! A complete log of this run can be found in:
[proxy] npm ERR! /root/.npm/_logs/2019-02-07T23_05_36_007Z-debug.log
[proxy] npm run proxy exited with code 1
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! bmex-orderer@0.6.2 startup: `concurrently --allow-restart "npm:proxy" "npm:start"`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the bmex-orderer@0.6.2 startup script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2019-02-07T23_05_36_034Z-debug.log
root@andromeda:/home/desktop/bitmex-scaled-orders#
Well the issue is node not discovering the modules per folder so you need to update the code to point to js files instead of folders
so for example update src/App.js
with:
import Dashboard from "containers/Dashboard";
to:
import Dashboard from "containers/Dashboard/index.js";
so you basically need to modify the path to point to the file not the folder, not sure what causes this problem the project worked right away on my windows 10 with node v10.14.2 however it didn't work on my ubutnu server with node v8.11.2 and i was able to fix it with my previous answer. this may help https://stackoverflow.com/questions/42163049/node-js-require-from-parent-folder
Thanks @ahmedengu Indeed it works out of the box on windows but not on Linux, shame, I would be great to have this running OOTB on a dedicated local Linux server.
Hello, I can't startup the instance on Ubuntu 18.04.1 LTS, npm 6.4.1 & node v11.3.0