ts-node
ts-node copied to clipboard
Using ts-node main branch as a dependency fails on GitHub Actions with pnpm
Search Terms
pnpm ERR_PNPM_PREPARE_PACKAGE prepack TS2742 macroReplNoErrorsAndStdoutContains macroReplStderrContains @cspotcode/ava-lib
Expected Behavior
install github:TypeStrong/ts-node#main as a dependency successfully.
Actual Behavior
install github:TypeStrong/ts-node#main as a dependency failed.
...1816_0fa4b34047b2a870b11744b3f7556d5f prepack$ node ./scripts/prepack.mjs
...1816_0fa4b34047b2a870b11744b3f7556d5f prepack: > [email protected] prepack-worker /home/runner/setup-pnpm/node_modules/.bin/store/v3/tmp/_tmp_1816_0fa4b34047b2a870b11744b3f7556d5f
...1816_0fa4b34047b2a870b11744b3f7556d5f prepack: > rimraf temp dist tsconfig.schema.json tsconfig.schemastore-schema.json tsconfig.tsbuildinfo tests/ts-node-packed.tgz tests/node_modules tests/tmp && tsc -b ./tsconfig.build-dist.json && typescript-json-schema --topRef --refs --validationKeywords allOf --out tsconfig.schema.json tsconfig.build-schema.json TsConfigSchema && node --require ./register ./scripts/create-merged-schema
##[debug]Dropping file value '/home/runner/work/action-runner-test/action-runner-test/...1816_0fa4b34047b2a870b11744b3f7556d5f prepack: src/test/repl/helpers/macros.ts'. Path does not exist
Error: ...1816_0fa4b34047b2a870b11744b3f7556d5f prepack: src/test/repl/helpers/macros.ts(4,14): error TS2742: The inferred type of 'macroReplNoErrorsAndStdoutContains' cannot be named without a reference to '.bin/store/v3/tmp/_tmp_1816_0fa4b34047b2a870b11744b3f7556d5f/node_modules/@cspotcode/ava-lib'. This is likely not portable. A type annotation is necessary.
##[debug]Dropping file value '/home/runner/work/action-runner-test/action-runner-test/...1816_0fa4b34047b2a870b11744b3f7556d5f prepack: src/test/repl/helpers/macros.ts'. Path does not exist
Error: ...1816_0fa4b34047b2a870b11744b3f7556d5f prepack: src/test/repl/helpers/macros.ts(9,14): error TS2742: The inferred type of 'macroReplStderrContains' cannot be named without a reference to '.bin/store/v3/tmp/_tmp_1816_0fa4b34047b2a870b11744b3f7556d5f/node_modules/@cspotcode/ava-lib'. This is likely not portable. A type annotation is necessary.
...1816_0fa4b34047b2a870b11744b3f7556d5f prepack: ELIFECYCLE Command failed with exit code 2.
...1816_0fa4b34047b2a870b11744b3f7556d5f prepack: Failed
ERR_PNPM_PREPARE_PACKAGE Failed to prepare git-hosted package fetched from "https://codeload.github.com/TypeStrong/ts-node/tar.gz/0eb980f2b7e86801eca76782a323f7ad696784ab": [email protected] prepack: `node ./scripts/prepack.mjs`
Exit status 1
Error: Process completed with exit code 1.
Steps to reproduce the problem
I install dependencies in my computer with no problem. But there is some errors on GitHub Actions.
https://github.com/WankkoRee/action-runner-test/actions/runs/6283895211/job/17064801621
Minimal reproduction
https://github.com/WankkoRee/action-runner-test
Specifications
GitHub Actions runner 2.309.0 with Node.js 18.17.1 and pnpm 8.7.6
I have the same issue
https://github.com/AllanOricil/nrg-cli/actions/runs/10755041762/job/29826291624
RUN v2.0.5 /home/runner/work/nrg-cli/nrg-cli
❯ test/index.spec.ts (14 tests | 2 failed) 1752ms
× cli > should handle missing command with a help message
→ expected 'Command failed: npx ts-node ./src/ind…' to contain 'You need at least one command before …'
× cli > should display the version
→ Command failed: npx ts-node ./src/index.ts --version
TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".ts" for /home/runner/work/nrg-cli/nrg-cli/src/index.ts
at Object.getFileProtocolModuleFormat [as file:] (node:internal/modules/esm/get_format:160:9)
at defaultGetFormat (node:internal/modules/esm/get_format:203:36)
at defaultLoad (node:internal/modules/esm/load:143:22)
at async nextLoad (node:internal/modules/esm/hooks:866:22)
at async nextLoad (node:internal/modules/esm/hooks:866:22)
at async Hooks.load (node:internal/modules/esm/hooks:449:20)
at async handleMessage (node:internal/modules/esm/worker:196:18) {
code: 'ERR_UNKNOWN_FILE_EXTENSION'
}
⎯⎯⎯⎯⎯⎯⎯ Failed Tests 2 ⎯⎯⎯⎯⎯⎯⎯
FAIL test/index.spec.ts > cli > should handle missing command with a help message
AssertionError: expected 'Command failed: npx ts-node ./src/ind…' to contain 'You need at least one command before …'
- Expected
+ Received
- You need at least one command before moving on
+ Command failed: npx ts-node ./src/index.ts
+ TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".ts" for /home/runner/work/nrg-cli/nrg-cli/src/index.ts
+ at Object.getFileProtocolModuleFormat [as file:] (node:internal/modules/esm/get_format:160:9)
+ at defaultGetFormat (node:internal/modules/esm/get_format:203:36)
+ at defaultLoad (node:internal/modules/esm/load:143:22)
+ at async nextLoad (node:internal/modules/esm/hooks:866:22)
+ at async nextLoad (node:internal/modules/esm/hooks:866:22)
+ at async Hooks.load (node:internal/modules/esm/hooks:449:20)
+ at async MessagePort.handleMessage (node:internal/modules/esm/worker:196:18) {
+ code: 'ERR_UNKNOWN_FILE_EXTENSION'
+ }
+
❯ test/index.spec.ts:256:29
254| throw Error();
255| } catch (error: unknown) {
256| expect(error.message).toContain(
| ^
257| "You need at least one command before moving on",
258| );
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/2]⎯
FAIL test/index.spec.ts > cli > should display the version
Error: Command failed: npx ts-node ./src/index.ts --version
TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".ts" for /home/runner/work/nrg-cli/nrg-cli/src/index.ts
at Object.getFileProtocolModuleFormat [as file:] (node:internal/modules/esm/get_format:160:9)
at defaultGetFormat (node:internal/modules/esm/get_format:203:36)
at defaultLoad (node:internal/modules/esm/load:143:22)
at async nextLoad (node:internal/modules/esm/hooks:866:22)
at async nextLoad (node:internal/modules/esm/hooks:866:22)
at async Hooks.load (node:internal/modules/esm/hooks:449:20)
at async handleMessage (node:internal/modules/esm/worker:196:18) {
code: 'ERR_UNKNOWN_FILE_EXTENSION'
}
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[2/2]⎯
Test Files 1 failed (1)
Tests 2 failed | [12](https://github.com/AllanOricil/nrg-cli/actions/runs/10755041762/job/29826291624#step:7:13) passed (14)
Start at 22:59:21
Duration 2.08s (transform 123ms, setup 0ms, collect 82ms, tests 1.75s, environment 0ms, prepare 66ms)
Error: AssertionError: expected 'Command failed: npx ts-node ./src/ind…' to contain 'You need at least one command before …'
- Expected
+ Received
- You need at least one command before moving on
+ Command failed: npx ts-node ./src/index.ts
+ TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".ts" for /home/runner/work/nrg-cli/nrg-cli/src/index.ts
+ at Object.getFileProtocolModuleFormat [as file:] (node:internal/modules/esm/get_format:160:9)
+ at defaultGetFormat (node:internal/modules/esm/get_format:203:36)
+ at defaultLoad (node:internal/modules/esm/load:[14](https://github.com/AllanOricil/nrg-cli/actions/runs/10755041762/job/29826291624#step:7:15)3:22)
+ at async nextLoad (node:internal/modules/esm/hooks:866:22)
+ at async nextLoad (node:internal/modules/esm/hooks:866:22)
+ at async Hooks.load (node:internal/modules/esm/hooks:449:20)
+ at async MessagePort.handleMessage (node:internal/modules/esm/worker:196:18) {
+ code: 'ERR_UNKNOWN_FILE_EXTENSION'
+ }
+