-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[Bug] Typescript 4.3.2 Cannot apply hunk #2 #2952
Comments
Duplicate of #2938 |
I just encountered this issue when trying to install the latest version of NextJS via [1], and I noticed [2] yielded the same error message as the one described in the issue, which I was able to reproduce by running the three commands the original poster provided. [1] Once I removed the "--ts" flag, both of them worked without any errors, which further proves there's something wrong with the Typescript installation, especially because replacing "@12" with "@latest" solved the issue. Upon closer inspection, I realized that it both [1] and [2] would default to install packages with Yarn since it's available globally on my machine. Once I uninstalled Yarn via [3] and ran [1], the NextJS installation proceeded via NPM without any errors. [3] According to this user, Yarn patches TypeScript to add support for PNP, which sometimes goes bad and in my opinion should be an opt-in (and potential headache) for YARN PNP users only. Otherwise the only way out I found for NPM and YARN users is to get rid of Yarn altogether. Since I don't have the expertise to make a pull request, here's my configuration [4] for anyone who's willing to work on that: [4]
|
Describe the bug
Can't install TypeScript v4.3.2.
Received this:
A clear and concise description of what the bug is. A bug is unintended. A feature not being
implemented is not a bug, and your issue may be closed for misleading labeling.
To Reproduce
The minimal information needed to reproduce your issue (ideally a package.json with a single dep).
Note that bugs without minimal reproductions will be closed as non-actionable.
yarn init -2
yarn
yarn add -D typescript
Screenshots
If applicable, add screenshots to help explain your problem.
Environment if relevant (please complete the following information):
The text was updated successfully, but these errors were encountered: