4
4

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.

LaravelMIX セットアップ

Last updated at Posted at 2018-03-23

$ 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/

nvm use v6.0.0
node -v

npm install -g npm@5.7.1

インストールやり直し

npm install --no-bin-links

コンパイル

yarn run dev
4
4
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
4
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?