-
-
Notifications
You must be signed in to change notification settings - Fork 536
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
Cannot find module 'typescript'
when using npx ts-node
#1426
Comments
We declare typescript as a peerDependency. I would check if npx is installing peerDependencies or if you are required to do something else to make it install them. Also check the version of npx and npm; might be relevant. |
Thanks, I will try to get to that later. Right now I just wanted to report that this new release is causing trouble for us where everything worked fine before. Adding |
Always good to get the bug report. However, in this case, we didn't change anything with our typescript dependency declaration, so I don't think there's anything we should change to avoid what I assume is an Here are the code changes between 10.1.0 and 10.2.0 |
The funny bit here is that the environment, as far as we can figure out, is absolutely identical: https://github.com/prisma/e2e-tests/runs/3267534138
( Once the Unfortunately this But you are right, this is most probably not a |
Here is a demo that shows this is an npx issue. It runs 6x different test cases. The differentiating factor appears to be https://github.com/TypeStrong/ts-node-repros/blob/cspotcode-patch-1/run.sh |
This is definitely something about To repeat our "fix": |
May have something to do with
This would seem to indicate a change in ts-node not npx. |
Could also be a module hoisting issue, where it was never supposed to work, but it did accidentally due to npm's hoisting. What change should we make in ts-node? The typescript peerDependency didn't change so we shouldn't change that. |
Do you have a script to narrow down which commit causes a specific issue? Something like: for a set of commits:
There seem to be ~14 commits: v10.1.0...v10.2.0 to try. (Since commits are linear, it's possible to optimize and apply a binary search, but that's not needed since there are relatively few commits in this case) |
Something like "npm run build ; cd <directory> ; npm install <path to
tarball>" is probably your best bet. Our build script runs "npm pack"
automatically.
…On Tue, Aug 10, 2021, 4:00 PM wandyezj ***@***.***> wrote:
Do you have a script to narrow down which commit causes a specific issue?
Something like:
for a set of commits:
- move repository to commit
- build
- run test script that identifies the issue
There seem to be ~14 commits: v10.1.0...v10.2.0
<v10.1.0...v10.2.0> to try.
(Since commits are linear, it's possible to optimize and apply a binary
search, but that's not needed since there are relatively few commits in
this case)
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#1426 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAC35OAQGAZH2YHM2N7T5ZLT4GANNANCNFSM5BZ6ODOA>
.
|
We have been using
npx ts-node
to run a specific script for quite some while now, and with update 10.2.0 that script started to fail.Expected Behavior
Script works.
Actual Behavior
Steps to reproduce the problem
prisma/ecosystem-tests#1982
Minimal reproduction
Specifications
The text was updated successfully, but these errors were encountered: