Closed Eithea closed 2 years ago
I found this issue while looking at the GFI 🐤 but it works well for me. It's still not working? If it doesn't work, I would appreciate it if you could share the error reproduction environment in more detail. @Eithea
@taenykim
both of my laptops use windows10 without WSL and the problem arises.
npm i
, docker ...
)npm run benchmark
$ npm run benchmark
> yorkie-js-sdk@0.2.11 benchmark
> ts-node-script ./test/bench/**.ts
node:internal/modules/cjs/loader:936
throw err;
^
Error: Cannot find module './**.ts'
Require stack:
- ~\yorkie-js-sdk\test\bench\imaginaryUncacheableRequireResolveScript
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
at Function.resolve (node:internal/modules/cjs/helpers:108:19)
at requireResolveNonCached (~\yorkie-js-sdk\node_modules\ts-node\dist\bin.js:257:16)
at getProjectSearchDir (~\yorkie-js-sdk\node_modules\ts-node\dist\bin.js:227:35)
at Object.main (~\yorkie-js-sdk\node_modules\ts-node\dist\bin.js:131:27)
at Object.<anonymous> (~\yorkie-js-sdk\node_modules\ts-node\dist\bin-script.js:5:7)
at Module._compile (node:internal/modules/cjs/loader:1105:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'~\\yorkie-js-sdk\\test\\bench\\imaginaryUncacheableRequireResolveScript'
]
}
(~
is installed path)
This issue seems to be caused by using the glob pattern as argv of ts-node. "ts-node-script test/bench/**.ts"
I think it will be resolved by setting only one path as the entry point without using the glob pattern.
After testing, some console environments did not support the glob pattern.
npm run benchmark
[
'/usr/local/bin/node',
'/Users/user/Desktop/yorkie-js-sdk/node_modules/.bin/ts-node-script',
'test/bench/document_test.ts'
]
npm run benchmark
[
'C:\\Program Files\\nodejs\\node.exe',
'C:\\Users\\user\\Desktop\\test\\node_modules\\ts-node\\dist\\bin.js',
'./**.ts' # 🚨 do not support glob
]
Could I try this issue? @mojosoeun @blurfx
@taenykim Sure :)
What happened:
npm run benchamark
doesn't work in local (verified in Windows and Mac)What you expected to happen:
I expected it works normally like in CI but it returns error.
How to reproduce it (as minimally and precisely as possible):
Anything else we need to know?:
The other commands that run ts-node running a single script work normally.
If someone needs to test all bench in local, try
./node_modules/ts-node/dist/bin-script.js ./test/bench/**.ts
instead ofnpm run benchmark
.Environment:
yorkie version
):