I got this error after upgrading to webpack 4.29.x. It turned out that webpack 4.29.x triggered npm's peerDependency bug. And according to them, the bug is not going to get fixed soon. Here's the workaround from sokra
"acorn": "^6.0.5"
to your application package.json.yarn
. It doesn't have this bug.npm update acorn --depth 20
npm dedupe
(works only in some cases)rm package-lock.json
npm i
(works only in some cases)4.28.4
in your package.jsonUpdate
According to comment below, this bug doesn't exist anymore after 4.36.0