3
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

peer typescript@">=4.8.4 <6.1.0" from typescript-eslint@8.72.1

3
Posted at

はじめに

  • React TypeScriptなプロジェクトをviteで立ち上げ中、npm iがこけた

問題

  • typescript-eslint (eslintをtypescriptのコードに対して有効にするもの)がtsパッケージとバージョン合わず npm i 時エラー
  • 解決の流れ
    1. エラーメッセージを見て、typescript-eslint外したらインストールが通ることを確認
    2. 検索して参考1で本当に必要なのかを確認
    3. 必要そうだったので参考2を検索で見つけ、その中の参考3へのリンクを確認
% npm i
npm error code ERESOLVE
npm error ERESOLVE unable to resolve dependency tree
npm error 
npm error While resolving: <project-name>@0.0.0
npm error Found: typescript@"6.1.0"
npm error node_modules/typescript
npm error   dev typescript@"6.1.0" from the root project
npm error 
npm error Could not resolve dependency:
npm error peer typescript@">=4.8.4 <6.1.0" from typescript-eslint@8.72.1
npm error node_modules/typescript-eslint
npm error   dev typescript-eslint@"^8.72.0" from the root project
npm error 
npm error Fix the upstream dependency conflict, or retry this command with --force or --legacy-peer-deps to accept an incorrect (and potentially broken) dependency resolution.

解決

  • ts v7用のAPIがないらしい。[参考3] 記載のコマンドでv6にして対応。
npm install -D typescript@npm:@typescript/typescript6

終わりに

参考1

参考2

参考3

3
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?