CoinAlpha / gateway-api

Apache License 2.0
47 stars 25 forks source link

can not install when build from source code #50

Closed bixia closed 3 years ago

bixia commented 3 years ago

here is the way i install it : """ git clone cd

install npm packages

yarn install

setup config

cp .env.example .env

run dev mode with hot reload on code changes

yarn run dev

but i get the following errors:

PS C:\lqw\temp\gateway-api> yarn run dev yarn run v1.22.5 warning package.json: License should be a valid SPDX license expression $ nodemon --exec babel-node src/index.js [nodemon] 2.0.4 [nodemon] to restart at any time, enterrs [nodemon] watching path(s): *.* [nodemon] watching extensions: js,mjs,json [nodemon] startingbabel-node src/index.js` internal/process/esm_loader.js:74 internalBinding('errors').triggerUncaughtException( ^

Error [ERR_MODULE_NOT_FOUND]: Cannot find module 'C:\lqw\temp\gateway-api\src\app' imported from C:\lqw\temp\gateway-api\src\index.js at finalizeResolution (internal/modules/esm/resolve.js:276:11) at moduleResolve (internal/modules/esm/resolve.js:699:10) at Loader.defaultResolve [as _resolve] (internal/modules/esm/resolve.js:810:11) at Loader.resolve (internal/modules/esm/loader.js:86:40) at Loader.getModuleJob (internal/modules/esm/loader.js:230:28) at ModuleWrap. (internal/modules/esm/module_job.js:56:40) at link (internal/modules/esm/module_job.js:55:36) { code: 'ERR_MODULE_NOT_FOUND' } [nodemon] app crashed - waiting for file changes before starting... `

and i find it is the following line that doesn't work in src/index.js ` import app from './app'

` when i change it into the below it works:

import app from './app.js'

however, it doesnt make sense.

bixia commented 3 years ago

any comment?

RC-13 commented 3 years ago

@bixia Did you follow the installation step given on the setup.md (https://github.com/CoinAlpha/gateway-api/blob/master/setup.md)? Try checking as well if you're using the latest node, the latest version has a compatibility issue with some of the packages which may trigger that err_module_not_found. And double-check that the right information is added to your .env file. I just did a fresh install following the step and using node v10.22.1 and yarn v1.22.10 and didn't get any issue.