Skip to content

Cannot find module 'ts-node/register' #2904

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

Open
objectiveSee opened this issue Feb 21, 2025 · 7 comments · May be fixed by #2913
Open

Cannot find module 'ts-node/register' #2904

objectiveSee opened this issue Feb 21, 2025 · 7 comments · May be fixed by #2913
Labels

Comments

@objectiveSee
Copy link
Contributor

Describe the bug

Igniting a new app will fail with the following error. Specifically, it seems that npx expo install is run during Ignite's setup and that is the command which is failing. Re-running npx expo install will yield the same error. I was able to resolve this with a few alternatives:

Solutions:
a. Template should use old version of yarn, by adding key to package.json to pass yarn @1.x
eg. "packageManager": "[email protected]"
b. Add .yarnrc.yml with nodeLinker: node-modules
c. Use alternative to yarn ¯_(ツ)_/¯

Error: Error reading Expo config at ~/workspace/testapp/app.config.ts:
Cannot find module 'ts-node/register'

Options passed:

✅ What bundle identifier? · changeme.todo
✅ Where do you want to start your project? · 
✅ How do you want to manage Native code? · cng
✅ Do you want to initialize a git repository? (Y/n) · No
✅ Remove demo code? We recommend leaving it in if it's your first time using Ignite (y/N) · Yes
✅ Include MobX-State-Tree code? (recommended) (Y/n) · No
✅ Which package manager do you want to use? · yarn
✅ Do you want to install dependencies? (Y/n) · No
✅ [Experimental] Expo Router for navigation? (y/N) · No
✅ Enable the New Architecture? (y/N) · Yes

Reference

This question was also posted on Slack:

Ignite version

10.1.6

Additional info

🤖 > npx ignite-cli doctor
System
platform darwin
arch arm64
cpu 14 cores Apple M3 Max
directory hello /Users/anonymous/workspace/hello

~/.npm/_npx/e31027f3785124a8/node_modules/gluegun/build/index.js:15
throw up;
^

Error: Command failed: pnpm --version
~/.nvm/versions/node/v22.5.1/lib/node_modules/corepack/dist/lib/corepack.cjs:21601
if (key == null || signature == null) throw new Error(Cannot find matching keyid: ${JSON.stringify({ signatures, keys })});
^

Error: Cannot find matching keyid: {"signatures":[{"sig":"MEYCIQDbcyRXEEpUvMj22WsicmOsvx+ctqHZv1vLScf3/247EAIhANfMkRDNAHdtTDNZ34BVH2z2z0Ef8o5VK4osH6ES9RHW","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"keys":[{"expires":null,"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","keytype":"ecdsa-sha2-nistp256","scheme":"ecdsa-sha2-nistp256","key":"MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE1Olb3zMAFFxXKHiIkQO5cJ3Yhl5i6UPp+IhuteBJbuHcA5UogKo0EWtlWwW6KSaKoTNEYL7JlCQiVnkhBktUgg=="}]}
at verifySignature (/.nvm/versions/node/v22.5.1/lib/node_modules/corepack/dist/lib/corepack.cjs:21601:47)
at fetchLatestStableVersion (
/.nvm/versions/node/v22.5.1/lib/node_modules/corepack/dist/lib/corepack.cjs:21619:5)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async fetchLatestStableVersion2 (/.nvm/versions/node/v22.5.1/lib/node_modules/corepack/dist/lib/corepack.cjs:21738:14)
at async Engine.getDefaultVersion (
/.nvm/versions/node/v22.5.1/lib/node_modules/corepack/dist/lib/corepack.cjs:22340:23)
at async Engine.executePackageManagerRequest (/.nvm/versions/node/v22.5.1/lib/node_modules/corepack/dist/lib/corepack.cjs:22432:47)
at async Object.runMain (
/.nvm/versions/node/v22.5.1/lib/node_modules/corepack/dist/lib/corepack.cjs:23136:5)

Node.js v22.5.1

at genericNodeError (node:internal/errors:983:15)
at wrappedFn (node:internal/errors:537:14)
at ChildProcess.exithandler (node:child_process:421:12)
at ChildProcess.emit (node:events:520:28)
at maybeClose (node:internal/child_process:1105:16)
at ChildProcess._handle.onexit (node:internal/child_process:305:5) {

code: 1,
killed: false,
signal: null,
cmd: 'pnpm --version',
stdout: '',
stderr: '/.nvm/versions/node/v22.5.1/lib/node_modules/corepack/dist/lib/corepack.cjs:21601\n' +
' if (key == null || signature == null) throw new Error(Cannot find matching keyid: ${JSON.stringify({ signatures, keys })});\n' +
' ^\n' +
'\n' +
'Error: Cannot find matching keyid: {"signatures":[{"sig":"MEYCIQDbcyRXEEpUvMj22WsicmOsvx+ctqHZv1vLScf3/247EAIhANfMkRDNAHdtTDNZ34BVH2z2z0Ef8o5VK4osH6ES9RHW","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"keys":[{"expires":null,"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","keytype":"ecdsa-sha2-nistp256","scheme":"ecdsa-sha2-nistp256","key":"MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE1Olb3zMAFFxXKHiIkQO5cJ3Yhl5i6UPp+IhuteBJbuHcA5UogKo0EWtlWwW6KSaKoTNEYL7JlCQiVnkhBktUgg=="}]}\n' +
' at verifySignature (
/.nvm/versions/node/v22.5.1/lib/node_modules/corepack/dist/lib/corepack.cjs:21601:47)\n' +
' at fetchLatestStableVersion (/.nvm/versions/node/v22.5.1/lib/node_modules/corepack/dist/lib/corepack.cjs:21619:5)\n' +
' at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n' +
' at async fetchLatestStableVersion2 (
/.nvm/versions/node/v22.5.1/lib/node_modules/corepack/dist/lib/corepack.cjs:21738:14)\n' +
' at async Engine.getDefaultVersion (/.nvm/versions/node/v22.5.1/lib/node_modules/corepack/dist/lib/corepack.cjs:22340:23)\n' +
' at async Engine.executePackageManagerRequest (
/.nvm/versions/node/v22.5.1/lib/node_modules/corepack/dist/lib/corepack.cjs:22432:47)\n' +
' at async Object.runMain (~/.nvm/versions/node/v22.5.1/lib/node_modules/corepack/dist/lib/corepack.cjs:23136:5)\n' +
'\n' +
'Node.js v22.5.1\n'
}

Node.js v22.5.1

@frankcalise
Copy link
Contributor

hi @objectiveSee thanks for the report, can you provide the version of yarn you have ben default?

@objectiveSee
Copy link
Contributor Author

objectiveSee commented Feb 21, 2025

🤖 > yarn --version
4.5.3

@frankcalise
Copy link
Contributor

@objectiveSee we should be correcting this via yarnrc already, could you re-run with --debug enabled and see if these messages are in the logs at all? Perhaps it's a different issue.

@objectiveSee
Copy link
Contributor Author

@frankcalise just re-ran with npx ignite-cli@latest new mobile --debug and had the same result. I don't see any yarn related logs that seem to match that. error is still Cannot find module 'ts-node/register'

@frankcalise
Copy link
Contributor

@objectiveSee is that file getting created at all?

@objectiveSee
Copy link
Contributor Author

.yarnrc.yml? That file doesn't exist .

Image

@frankcalise
Copy link
Contributor

Did you try creating the file and installing?

yarnrc.yml

nodeLinker: node-modules

@frankcalise frankcalise linked a pull request Mar 19, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants