Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Laravel - npm run watch - runs repeatedly - nonstop

Tags:

npm

laravel

I have installed Laravel. I use the Visual Studio Code to develop on my Windows 10. I have installed the npm and node. And ran install based on Laravel's default package.json, using npm install command. I kept the file unchanged, and it looks like this:

{
  "private": true,
  "scripts": {
    "dev": "npm run development",
    "development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
    "watch": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
    "watch-poll": "npm run watch -- --watch-poll",
    "hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",
    "prod": "npm run production",
    "production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
  },
  "devDependencies": {
    "axios": "^0.15.3",
    "bootstrap-sass": "^3.3.7",
    "cross-env": "^3.2.3",
    "jquery": "^3.1.1",
    "laravel-mix": "0.*",
    "lodash": "^4.17.4",
    "vue": "^2.1.10"
  }
}

The problem is, that running npm run watch, does not just make the npm wait for changes. npm runs the npm run dev all the time, over and over again!

like image 426
Makan Tayebi Avatar asked Mar 10 '23 02:03

Makan Tayebi


1 Answers

The proper answer to this issue was addressed here

https://github.com/JeffreyWay/laravel-mix/issues/228

It also has solution to resolve it and what causes it.

like image 79
Nitish Kumar Avatar answered Mar 30 '23 12:03

Nitish Kumar