-2

I have tried to run npm run dev and got this error:

enter image description here

I've tried:

  • composer update
  • rm -rf node_modules
  • npm cache clean
  • npm install
  • npm outdated
  • npm install
  • npm run dev

and still didn't work. Can someone help me?

matiaslauriti
  • 7,065
  • 4
  • 31
  • 43
Preman Terminal
  • 149
  • 4
  • 16

2 Answers2

9

Please check laravel-mix version and scripts commands in package.json file

for laravel-mix 5.*.*

"scripts": {
    "dev": "npm run development",
    "development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --config=node_modules/laravel-mix/setup/webpack.config.js",
    "watch": "npm run development -- --watch",
    "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 --disable-host-check --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 --no-progress --config=node_modules/laravel-mix/setup/webpack.config.js"
}

for laravel-mix 6.*.*

"scripts": {
    "dev": "npm run development",
    "development": "mix",
    "watch": "mix watch",
    "watch-poll": "mix watch -- --watch-options-poll=1000",
    "hot": "mix watch --hot",
    "prod": "npm run production",
    "production": "mix --production"
},
F.E
  • 688
  • 6
  • 10
-1

Well, it looks like some files got corrupt when you run npm install

so I f you confused about some settings, I suggest you to build new project and run again npm install && npm run dev

desertnaut
  • 57,590
  • 26
  • 140
  • 166