one ERROR in ./node_modules/util/util.js
Module build failed (from ./node_modules/source-map-loader/dist/cjs.js): Error: ENOENT: no such file or directory, open 'C:\Users\shivani_sahu\dm-reactpjt\contact-app\node_modules\util\util.js'
Seeing utiL, I thought to install util by npm install util but then it again show an error which is as follows: To solve it: npm install util, and add it into webpack.config.js:
BREAKING CHANGE:webpack < 5 used to include polyfills for node.js core modules by default. This is no longer the case. Verify if you need this module and configure a polyfill for it. If you want to include a polyfill, you need to: add a fallback 'resolve.fallback: { "util": require.resolve("util/") }', install 'util'; If you don't want to include a polyfill, you can use an empty module like this:resolve.fallback: { "util": false } @ ./node_modules/webpack/lib/index.js 74:30-50 77:9-29 @ ./src/googlesheets.js 21:16-34 @ ./src/index.js 1:0-44 2:0-10
This particular error I searched on google as to how to resolve it and I found a solution in 'stack overflow' which I tried but no result. Following is the solution which I tried in my ones:
Go to the node_modules folder
Search for the react-scripts folder
Inside config folder, you will see webpack.config.js file.
Under the resolve part in line number 303, add this
resolve: { fallback: { util: require.resolve("util/") }, // ... }
I'd be very grateful if anyone could help me to overcome this error.