Closed namitoyokota closed 2 years ago
It works fine on my mac:
yarn add @swc-node/register typescript -D
yarn add v1.22.18
info No lockfile found.
[1/4] 🔍 Resolving packages...
[2/4] 🚚 Fetching packages...
[3/4] 🔗 Linking dependencies...
[4/4] 🔨 Building fresh packages...
success Saved lockfile.
success Saved 14 new dependencies.
info Direct dependencies
├─ @swc-node/register@1.5.0
└─ typescript@4.6.3
info All dependencies
├─ @swc-node/core@1.9.0
├─ @swc-node/register@1.5.0
├─ @swc-node/sourcemap-support@0.2.0
├─ @swc/core-darwin-arm64@1.2.172
├─ @swc/core@1.2.172
├─ buffer-from@1.1.2
├─ colorette@2.0.16
├─ debug@4.3.4
├─ ms@2.1.2
├─ pirates@4.0.5
├─ source-map-support@0.5.21
├─ source-map@0.6.1
├─ tslib@2.4.0
└─ typescript@4.6.3
✨ Done in 1.84s.
I'm facing the same problem here.
Invariant Violation: could not find a copy of typescript to link in C:\Users\my-user\workspace\my-project\node_modules\@swc-node\register\node_modules
What can I do to fix it?
@daniellrsouza please provide this information so I can debug it:
I'm getting the same issue but I'm baffled as I'm not sure where we're getting this package from:
error An unexpected error occurred: "could not find a copy of typescript to link in ...\...\\node_modules\\@swc-node\\register\\node_modules".
OS: Windows 10 Enterprise, 10.0.19042 build 19042
Node v: 16.13.0
Pkg manager: Yarn (v1.22.17) but running npm in the background (v8.1.3)
Repro steps: Nuking our yarn.lock file and node modules with npx rimraf then running yarn install
.
I've done a quick fix in https://github.com/swc-project/swc-node/releases/tag/%40swc-node%2Fregister%401.5.1 Could you try does it work for you?
I've done a quick fix in https://github.com/swc-project/swc-node/releases/tag/%40swc-node%2Fregister%401.5.1 Could you try doest it work for you?
I was answering you with my information (OS, OS version, Node version etc) but this fix worked for me! =)
This worked for me as well. The issue was with Angular 13 version only supporting up to TypeScript 4.4.4.
Yep worked for me and for the same reason as above, thank you @Brooooooklyn!
Here is the error message on![image](https://user-images.githubusercontent.com/42247132/165538138-59c928da-f028-40af-8810-4d4c55440a45.png)
yarn install
: