Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
poppabear8883 opened this issue Jul 17, 2021 · 8 comments
Open

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

poppabear8883 opened this issue Jul 17, 2021 · 8 comments

Comments

@poppabear8883
Copy link

poppabear8883 commented Jul 17, 2021

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",
@riasvdv
Copy link
Owner

riasvdv commented Jul 22, 2021

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

@jasperf
Copy link

jasperf commented Nov 3, 2021

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.

@dillingham
Copy link

Came to report this also

@Aslam97
Copy link
Contributor

Aslam97 commented Jan 25, 2022

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

@dillingham
Copy link

@Aslam97 good catch

@Zhythero
Copy link

Zhythero commented Apr 18, 2022

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
Copy link

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

yarn add eslint eslint-webpack-plugin --dev

or the npm equivalent

@jasperf
Copy link

jasperf commented May 9, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants