laravel-mix-eslint icon indicating copy to clipboard operation
laravel-mix-eslint copied to clipboard

Error: Cannot find module 'eslint-webpack-plugin'

Open poppabear8883 opened this issue 4 years ago • 8 comments

Simply followed the instructions via README and when I run npm run watch I receive the error.

Laravel 8.41

"vue": "^3.1.5",
"eslint": "^7.30.0",
"eslint-plugin-vue": "^7.13.0",
"laravel-mix": "^6.0.25",
"laravel-mix-eslint": "^0.2.0",

poppabear8883 avatar Jul 17 '21 17:07 poppabear8883

Seems like this plugin isn't compatible with laravel-mix v6, I'll gladly accept a PR if you get it working, otherwise I'll try to do this when I find some time. It's not a high priority for me as I don't use this anymore

riasvdv avatar Jul 22 '21 07:07 riasvdv

That is too bad. Was just doing research on possible setups with eslint webpack plugin and eslint and started thread at https://laracasts.com/discuss/channels/elixir/webpack-eslint-setups-with-laravel-mix-6 . Do think we need something like

.webpackConfig({
    plugins: [
     new ESLintPlugin(options)
      }),
    ],

to load plugins in new Laravel Mix 6, but not quite done with the research.

jasperf avatar Nov 03 '21 03:11 jasperf

Came to report this also

dillingham avatar Nov 11 '21 00:11 dillingham

You need to install eslint-webpack-plugin manually. see https://github.com/riasvdv/laravel-mix-eslint/blob/master/index.js#L9 According to laravel-mix documentation what is returned from dependencies() will be installed by mix if you run npm run dev or npx mix but i don't know why it doesn't auto install.

so after you run npm install laravel-mix-eslint --save-dev you need to install eslint-webpack-plugin run npm install eslint-webpack-plugin --save-dev and then follow with npx mix

Aslam97 avatar Jan 25 '22 14:01 Aslam97

@Aslam97 good catch

dillingham avatar Jan 26 '22 00:01 dillingham

Hi it seems that the eslint dependency is not auto installed too. Manually ran yarn add eslint --dev along with yarn add eslint-webpack-plugin --dev.

Zhythero avatar Apr 18 '22 22:04 Zhythero

So for anyone encountering this issue in the future, do:

yarn add eslint eslint-webpack-plugin --dev

or the npm equivalent

Zhythero avatar Apr 18 '22 23:04 Zhythero

Yeah with eslint-webpack-plugin added this package does work. Just need to see how I can include prettier in the mix now but ESLint works well. Thanks @Zhythero and @Aslam97

jasperf avatar May 09 '22 03:05 jasperf