LoginSignup
0
0

More than 3 years have passed since last update.

React npm ERR! 解消メモ

Last updated at Posted at 2020-07-07

はじめに

暑くなってきて季節はもう夏ですね。
そんな暑い中エラーが出ると汗がだらだら。自分の代謝を恨みます。
就職を目指す駆け出しエンジニアの記事ですが、見てくださると嬉しいです!

npm ERR!

React学習途中、npm startを実行するとnpm ERR!が吐かれました。
スクリーンショット 2020-07-07 16.55.38.png

解消までに試したこと

To fix the dependency tree, try following the steps below in the exact orderに従ってみる

解決のための手順を示してくれているので、とりあえず1から4まで実行してみました。
1.package-lock.jsonをprojectフォルダーから消去
2.同じくnode-modulesも消去
3.package.jsonのdevDependenciesのjestを消去
4.パッケージマネージャーを基にnpm install

解決されませんでした。

jest??

ここで、少しじっくりみるとこの部分が気になりました
スクリーンショット 2020-07-07 17.14.02.png
jestがエラーを起こしていそうですね。
( jestはテストに利用していました。)
スクリーンショット 2020-07-07 17.22.03.png
どうやらcreate-react-appを実行した際に、既にnode-modulesのなかにjestがインストールされており、手動でinstallしたjestとバージョン違いが発生していたのかもしれません。
package.jsonからjestとbabel-jestを消去して、node-modulesも消去後もう一度npm installしてみます。

npm startが通りました
スクリーンショット 2020-07-07 17.27.42.png

まとめ

早く解決できて良かった!!

0
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
0
0