Closed philsong closed 3 years ago
If I add js postfix when import module, it works but it is a hard work, so how to resolve it?
again
@philsong Did you run yarn install
?
yes
@philsong Did you run
yarn install
?
@philsong Did you run
yarn install
?
â gateway-api git:(master) yarn install
yarn install v1.22.5
warning package.json: License should be a valid SPDX license expression
warning gateway-api@0.1.0: License should be a valid SPDX license expression
[1/4] ð Resolving packages...
success Already up-to-date.
âš Done in 0.69s.
â gateway-api git:(master) 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, enter rs
[nodemon] watching path(s): .
[nodemon] watching extensions: js,mjs,json
[nodemon] starting babel-node src/index.js
internal/process/esm_loader.js:74
internalBinding('errors').triggerUncaughtException(
^
Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/Users/phil/DeFi/gateway-api/src/app' imported from /Users/phil/DeFi/gateway-api/src/index.js
at finalizeResolution (internal/modules/esm/resolve.js:271:11)
at moduleResolve (internal/modules/esm/resolve.js:668:10)
at Loader.defaultResolve [as _resolve] (internal/modules/esm/resolve.js:779:11)
at Loader.resolve (internal/modules/esm/loader.js:85:40)
at Loader.getModuleJob (internal/modules/esm/loader.js:229:28)
at ModuleWrap.
resolved in below env: â gateway-api git:(master) â yarn -v 1.22.5 â gateway-api git:(master) â node -v v10.23.0 â gateway-api git:(master) â npm -v 6.14.8
â gateway-api git:(master) 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, enter
rs
[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 '/Users/phil/DeFi/gateway-api/src/app' imported from /Users/phil/DeFi/gateway-api/src/index.js at finalizeResolution (internal/modules/esm/resolve.js:271:11) at moduleResolve (internal/modules/esm/resolve.js:668:10) at Loader.defaultResolve [as _resolve] (internal/modules/esm/resolve.js:779:11) at Loader.resolve (internal/modules/esm/loader.js:85:40) at Loader.getModuleJob (internal/modules/esm/loader.js:229:28) at ModuleWrap. (internal/modules/esm/module_job.js:51:40)
at link (internal/modules/esm/module_job.js:50:36) {
code: 'ERR_MODULE_NOT_FOUND'
}
[nodemon] app crashed - waiting for file changes before starting...