————- REASON FOR ISSUE ————
Before we are using node js version 16.17.0 in react js project
and now wanna to upgrade in latest node js lts version which is 20.15.1
but there is issue please help me out how to fix this……
RROR in ./node_modules/dotenv/lib/main.js 24:11-24
Module not found: Error: Can’t resolve ‘fs’ in ‘D:1KSinghNewProjectsRollZ Dashwastemanagementviewsnode_modulesdotenvlib’
ERROR in ./node_modules/dotenv/lib/main.js 26:11-24
Module not found: Error: Can’t resolve ‘os’ in ‘D:1KSinghNewProjectsRollZ Dashwastemanagementviewsnode_modulesdotenvliblib’
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: { “os”: require.resolve(“os-browserify/browser”) }’
– install ‘os-browserify’
If you don’t want to include a polyfill, you can use an empty module like this:
resolve.fallback: { “os”: false }
webpack compiled with 2 errors and 1 warning
No issues found.
expecting our react app is runs in latest node js lts version.
Kamlesh Singh is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.