Cannot find module terser-webpack-plugin when run yarn serve in Vue 3 project

4k views Asked by At

I just created a Vue 3 project using Vue CLI using the default options, and when I try to run using yarn serve command I got this error

Error: Cannot find module '.../node_modules/terser-webpack-plugin/dist/index.js'. Please verify that the package.json has a valid "main" entry

What I can do to solve it?

1

There are 1 answers

0
Alexandre Heinen On BEST ANSWER

I solved this issue. There was the version of terser-webpack-plugin that was installed in my project. Today some more researchs I found the issue on github (https://github.com/webpack-contrib/terser-webpack-plugin/issues/491) and update my project and then works fine.