DEV Community

Katie Kirby
Katie Kirby

Posted on

N00b here! I'm sure this is an easy fix... tried installing the new webpack via stackoverflow but no luck...

Image description

Top comments (5)

Collapse
 
alida profile image
Alida W

Sounds like the webpack.config.js doesn't match the version of webpack in your node package manager.

Collapse
 
wolfhoundjesse profile image
Jesse M. Holmes

resolve.fallback was introduced in Webpack 5. Check your package.json to see which version of webpack you have. If it says it's using 5, go into your node_modules folder and look for webpack there. It will have its own package.json file with the version listed. Sometimes things just get out of sorts with node_modules, and the best thing you can do is delete that folder and the package-lock.json, then reinstall with npm i.

Collapse
 
cryptolyfe profile image
Katie Kirby

Thank you! I also discovered my react was incorrect! So I deleted the node modules and the package.json... my next question is: Do I need to also delete the package-lock.json? Seems logical...

Thread Thread
 
wolfhoundjesse profile image
Jesse M. Holmes

You can. It will generate a new one for you when you install.

Thread Thread
 
cryptolyfe profile image
Katie Kirby

thanks again!