Module build failed (from ./node_modules/source-map-loader/dist/cjs.js)

Viewed 4511

I'm trying to make an ecommerce website with React. And it was working perfectly but after I install redux and react-redux, I'm getting this error:

Uncaught Error: Module build failed (from ./node_modules/source-map-loader/dist/cjs.js):
Error: ENOENT: no such file or directory, open 'D:\ProgrammingHero\foodie\client\node_modules\core-js-pure\modules\esnext.global-this.js'
    at ./node_modules/core-js-pure/modules/esnext.global-this.js (global-this.js:6:1)
    at options.factory (startup:7:1)
    at __webpack_require__ (jsonp chunk loading:133:1)
    at fn (jsonp chunk loading:367:1)
    at ./node_modules/core-js-pure/full/global-this.js (global-this.js:2:1)
    at options.factory (startup:7:1)
    at __webpack_require__ (jsonp chunk loading:133:1)
    at fn (jsonp chunk loading:367:1)
    at ./node_modules/core-js-pure/features/global-this.js (global-this.js:1:1)
    at options.factory (startup:7:1)

But if I uninstall redux and react-redux it works perfectly.

2 Answers

Delete your node_module folder and then run

 npm i

It solves the problem for me

I was reinstall my package.json without delating node_modules and it worked:

just write this :

npm i
Related