Edited at

LaravelMIX セットアップ

More than 1 year has passed since last update.

$ npm run dev

events.js:183

throw er; // Unhandled 'error' event
^

Error: spawn node_modules/webpack/bin/webpack.js ENOENT
at _errnoException (util.js:1022:11)
at Process.ChildProcess._handle.onexit (internal/child_process.js:190:19)
at onErrorNT (internal/child_process.js:372:16)
at _combinedTickCallback (internal/process/next_tick.js:138:11)
at process._tickCallback (internal/process/next_tick.js:180:9)
at Function.Module.runMain (module.js:695:11)
at startup (bootstrap_node.js:188:16)
at bootstrap_node.js:609:3
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! -y@1.0.0 development: `cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progr
ules --config=node_modules/laravel-mix/setup/webpack.config.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the -y@1.0.0 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! /home/vagrant/.npm/_logs/2018-03-23T10_24_44_446Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! -y@1.0.0 dev: `npm run development`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the -y@1.0.0 dev 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! /home/vagrant/.npm/_logs/2018-03-23T10_24_44_474Z-debug.log


原因

npmバージョンと、nodeバージョンが合っていなかった

※node6.0.0に対しnpm5.7

参考:nodeとnpmのバージョン一覧

https://nodejs.org/ja/download/releases/


やったこと

npmバージョンと、nodeバージョンを揃える

⇒node.js のバージョン管理とバージョン指定インストールについては

 こちらを参照しました

 https://hombre-nuevo.com/javascript/node0005/

インストールやり直し



npm install --no-bin-links