0
0

More than 5 years have passed since last update.

npm startしてもエラーが出る問題

Last updated at Posted at 2019-06-27

今回のエラー

React Reduxの環境構築で躓きました
全てインストール出来たと思い、意気揚々とコマンドを打つ:sunglasses:

$ npm start

すると、以下のエラーコードが出てきて全く動きません:thinking:

There might be a problem with the project dependency tree....以下略
スクリーンショット 2019-06-26 11.38.40.png

反省点

どの言語も共通で、エラー文をよく読むこと
画像内にあるオレンジ色の番号通りに進めて行けば無事解決しました:ok_hand:
一応下に書き記しておきます

  1. Delete package-lock.json (not package.json!) and/or yarn.lock in your project folder.

  2. Delete node_modules in your project folder.

  3. Remove "webpack" from dependencies and/or devDependencies in the package.json file in your project folder.

  4. Run npm install or yarn, depending on the package manager you use.

In most cases, this should be enough to fix the problem.
If this has not helped, there are a few other things you can try:

  5. If you used npm, install yarn (http://yarnpkg.com/) and repeat the above steps with it instead.
     This may help because npm has known issues with package hoisting which may get resolved in future versions.

  6. Check if /Users/home/node_modules/webpack is outside your project directory.
     For example, you might have accidentally installed something in your home folder.

  7. Try running npm ls webpack in your project folder.
     This will tell you which other package (apart from the expected react-scripts) installed webpack.

参考元

npm startで怒られたときの話

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