Laravel-mix: npm run dev error after upgrading to Spark 4.0

Created on 5 Feb 2017  路  9Comments  路  Source: JeffreyWay/laravel-mix

I upgrade my project from Spark 3 to 4 this morning. When running npm run dev I get the following error without much information on the cause at 95%. I've attached my npm-debug.log and webpack.mix.js files.

I'm running Homestead on Windows 10. I have symlinks enabled and npm install worked without any errors.

vagrant@homestead:~/amp$ npm run dev

@ dev /home/vagrant/amp
node node_modules/cross-env/bin/cross-env.js NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js

fallbackLoader option has been deprecated - replace with "fallback"
loader option has been deprecated - replace with "use"
95% emittingError: EIO: i/o error, close

npm ERR! Linux 4.4.0-51-generic
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "dev"
npm ERR! node v7.4.0
npm ERR! npm v4.0.5
npm ERR! code ELIFECYCLE
npm ERR! @ dev: node node_modules/cross-env/bin/cross-env.js 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 @ dev script 'node node_modules/cross-env/bin/cross-env.js NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node node_modules/cross-env/bin/cross-env.js NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! /home/vagrant/amp/npm-debug.log

npm-debug.txt.txt
webpack.mix.txt.txt

Most helpful comment

I also facing the same issue. This is what I did to solve the issue:

  1. Remove all the Elixir dependencies.
  2. Remove less-loader dependency.
  3. Clear everything inside the node-modules folder.
  4. Do a fresh install for all the node modules. (npm install).
  5. Compile the the project. (npm run dev).

All 9 comments

Can you check your package.json file and tell me if there are any old Laravel Elixir dependencies? That may be clashing with what Laravel Mix requests.

I removed the dependencies listed in the upgrade guide. Here's my package.json file.

{
  "private": true,

  "devDependencies": {
    "gulp": "^3.8.8"
  },

  "dependencies": {
    "axios": "^0.15.2",
    "bootstrap": "^3.0.0",
    "font-awesome": "^4.7.0",
    "jquery": "^2.1.4",
    "js-cookie": "^2.1.0",
    "laravel-mix": "^0.6.0",
    "less-loader": "^2.2.3",
    "moment": "^2.10.6",
    "promise": "^7.1.1",
    "sweetalert": "^1.1.3",
    "underscore": "^1.8.3",
    "urijs": "^1.17.0",
    "vue": "~2.1.1"
  },
  "scripts": {
    "dev": "node node_modules/cross-env/bin/cross-env.js NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
    "watch": "node node_modules/cross-env/bin/cross-env.js NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
    "hot": "node node_modules/cross-env/bin/cross-env.js NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",
    "production": "node node_modules/cross-env/bin/cross-env.js NODE_ENV=production node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
  }
}

Can you try running this command directly on the terminal? Does it change the output at all?

node node_modules/cross-env/bin/cross-env.js NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js

@JeffreyWay That gave me 3 errors. The first one is it cannot find FontAwesome. Let me fix that when I get some time to look at it and see if the other errors disappear when that one does.

I'll updated the thread when I do that.

FWIW I have the same error, running Windows 8.1. Just upgraded from Laravel 5.3 to 5.4 and Spark 3.0 to 4.0 (following these notes). Ran npm run dev and got the error

Module parse failed: c:[path_to_app]resourcesassetslessapp.less Unexpected character '@' (1:0)

This is my package.json file:

{
  "private": true,
  "devDependencies": {
    "gulp": "^3.8.8"
  },
  "dependencies": {
    "axios": "~0.15.2",
    "bootstrap": "^3.0.0",
    "jquery": "^2.1.4",
    "js-cookie": "^2.1.0",
    "laravel-mix": "^0.6.0",
    "less-loader": "^2.2.3",
    "moment": "^2.10.6",
    "promise": "^7.1.1",
    "sweetalert": "^1.1.3",
    "underscore": "^1.8.3",
    "urijs": "^1.17.0",
    "vue": "~2.0.1",
    "vue-template-compiler": "^2.0.8"
  },
  "scripts": {
    "dev": "node node_modules/cross-env/bin/cross-env.js NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
    "watch": "node node_modules/cross-env/bin/cross-env.js NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
    "hot": "node node_modules/cross-env/bin/cross-env.js NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",
    "production": "node node_modules/cross-env/bin/cross-env.js NODE_ENV=production node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
  }
}

@JeffreyWay The path to FontAwesome was incorrect. Fixing that has it working. Thanks.

I also facing the same issue. This is what I did to solve the issue:

  1. Remove all the Elixir dependencies.
  2. Remove less-loader dependency.
  3. Clear everything inside the node-modules folder.
  4. Do a fresh install for all the node modules. (npm install).
  5. Compile the the project. (npm run dev).

@allentcm Thank you, this worked for me.

Another solution that worked for me:

Make sure you don't have any other 'npm run dev' running for any other projects that you may have opened. In my case, I had another project running, and I installed a new project and then tried to run 'npm run dev', this caused the error. Close the first server and try to run the new project and it should work.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sdebacker picture sdebacker  路  3Comments

Bomavi picture Bomavi  路  3Comments

hasnatbabur picture hasnatbabur  路  3Comments

mstralka picture mstralka  路  3Comments

jpmurray picture jpmurray  路  3Comments