LoginSignup
54
53

More than 5 years have passed since last update.

Laravel-Mixコンパイル時のcode ELIFECYCLEエラーに対応する

Posted at

概要

Laravel-Mixコンパイル時のエラーに対応したのでメモ。

事象

Laravel-Mixのコンパイルを実行すると、code ELIFECYCLE〜のエラーが発生。

npm run dev
npm run watch
npm run production

-------

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ development: `cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @ development script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/xxxx/.npm/_logs/xxxx.log

対策

node_modulesを入れ直す

#既存jsモジュール群を全削除
rm -rf node_modules

#lockファイルを削除
rm package-lock.json yarn.lock

#npmのキャッシュをクリア
npm cache clear --force

#jsモジュール群をインストール
npm install

#動作確認
npm run dev

参考

Sudden npm error

LaravelMIX セットアップ

54
53
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
54
53