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

More than 3 years have passed since last update.

【エラー解決】ERROR in Entry module not found: Error: Can't resolve './src'

Posted at

アプリ開発をしている中で、yarn startをしても下記のようなエラーが発生してyarn startができなくなったので、解決法を探しました。

ERROR in Entry module not found: Error: Can't resolve './src'

package.json

何かあれこれいじってるうちに、package.jsonのscripts部分を下記のように変更してしまっていました。

  "scripts": {
    "start": "webpack-dev-server --content-base src --mode development --inline",
  },

なので、こちらの記事を参考に、

   "start": "react-scripts start",

このように戻し、yarn startすると、ターミナル上に「バグを直すためにこれこれやってください」という手順が示されました(スクショ撮り忘れました、、)。

バグ修正でやったこと

ざっくりとですが、指示に書いてあった内容を振り返ると、

  • `node_modules{のフォルダを削除
  • yarn.lockファイルを削除
  • ターミナルでyarnを実行
  • そしてyarn start

以上のような手順でエラーを消すことが出来ました。

まとめ

package.jsonまわりの理解がまだまだ乏しいので、しっかりどこで何が行われているのかを把握していきたいと思います。

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?