Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix yarn example:node throw error #201

Merged
merged 1 commit into from
May 2, 2022

Conversation

F3n67u
Copy link
Contributor

@F3n67u F3n67u commented Mar 25, 2022

when running yarn example:node, the below error happened because of the wrong path: ../register.js

yarn example:node        
yarn run v1.22.10
$ yarn build && cd ./example/node && ts-node -r ../register.js main.ts
$ rimraf lib && tsc -p .
Error: Cannot find module '../register.js'
Require stack:
- internal/preload
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15)
    at Function.Module._resolveFilename.sharedData.moduleResolveFilenameHook.installedValue [as _resolveFilename] (/Users/xxx/Lab/tsconfig-paths/node_modules/@cspotcode/source-map-support/source-map-support.js:679:30)
    at Function.Module._load (internal/modules/cjs/loader.js:746:27)
    at Module.require (internal/modules/cjs/loader.js:974:19)
    at Function.Module._preloadModules (internal/modules/cjs/loader.js:1244:12)
    at register (/Users/xxx/Lab/tsconfig-paths/node_modules/ts-node/src/index.ts:585:46)
    at phase4 (/Users/xxx/Lab/tsconfig-paths/node_modules/ts-node/src/bin.ts:480:11)
    at bootstrap (/Users/xxx/Lab/tsconfig-paths/node_modules/ts-node/src/bin.ts:85:10)
    at main (/Users/xxx/Lab/tsconfig-paths/node_modules/ts-node/src/bin.ts:54:10)
    at Object.<anonymous> (/Users/xxx/Lab/tsconfig-paths/node_modules/ts-node/src/bin.ts:717:3) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [ 'internal/preload' ]
}
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

@jonaskello jonaskello merged commit ba654b5 into dividab:master May 2, 2022
@jonaskello
Copy link
Member

Thanks!

@F3n67u F3n67u deleted the fix/example-node branch May 3, 2022 01:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants