title: Error: Can't resolve 'path' in 'C:\work\demo\node_modules\mime-types'
body: <p>getting error after update <strong>&quot;react-scripts&quot;: &quot;4.0.3&quot;</strong> to <strong>&quot;react-scripts&quot;: &quot;5.0.1&quot;,</strong> let me know why I am getting this error or how can I fix this...</p>
  <p>ERROR in ./node_modules/mime-types/index.js 15:14-37</p>
  <p>Module not found: Error: Can't resolve 'path' in 'C:\work\sams-frontend-su\node_modules\mime-types'</p>
  <p>BREAKING CHANGE: webpack &lt; 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.</p>
  <p>If you want to include a polyfill, you need to:
  - add a fallback 'resolve.fallback: { &quot;path&quot;: require.resolve(&quot;path-browserify&quot;) }'
  - install 'path-browserify'
  If you don't want to include a polyfill, you can use an empty module like this:
  resolve.fallback: { &quot;path&quot;: false }</p>
  <p>also, I created a webpack.config.js file in the parent path</p>
  <pre><code>module.exports = {
    resolve: {
      fallback: { &quot;path&quot;: require.resolve(&quot;path-browserify&quot;) },
    },
  };
  </code></pre>
  <p>Package.json</p>
  <pre><code>{
      &quot;dependencies&quot;: {
      &quot;@testing-library/jest-dom&quot;: &quot;^5.16.4&quot;,
      &quot;@testing-library/react&quot;: &quot;^13.2.0&quot;,
      &quot;@testing-library/user-event&quot;: &quot;^13.5.0&quot;,
      &quot;web-vitals&quot;: &quot;^2.1.4&quot;
    },
    &quot;scripts&quot;: {
      &quot;start&quot;: &quot;react-scripts start&quot;,
      &quot;build&quot;: &quot;react-scripts build&quot;,
      &quot;test&quot;: &quot;react-scripts test&quot;,
      &quot;eject&quot;: &quot;react-scripts eject&quot;
    },
    &quot;eslintConfig&quot;: {
      &quot;extends&quot;: [
        &quot;react-app&quot;,
        &quot;react-app/jest&quot;
      ]
    },
    &quot;browserslist&quot;: {
      &quot;production&quot;: [
        &quot;&gt;0.2%&quot;,
        &quot;not dead&quot;,
        &quot;not op_mini all&quot;
      ],
      &quot;development&quot;: [
        &quot;last 1 chrome version&quot;,
        &quot;last 1 firefox version&quot;,
        &quot;last 1 safari version&quot;
      ]
    },
    &quot;devDependencies&quot;: {
      &quot;@babel/cli&quot;: &quot;^7.17.10&quot;,
      &quot;@babel/core&quot;: &quot;^7.18.0&quot;,
      &quot;@babel/preset-env&quot;: &quot;^7.18.0&quot;,
      &quot;@emotion/react&quot;: &quot;^11.9.0&quot;,
      &quot;@emotion/styled&quot;: &quot;^11.8.1&quot;,
      &quot;@mui/icons-material&quot;: &quot;^5.8.0&quot;,
      &quot;@mui/lab&quot;: &quot;^5.0.0-alpha.82&quot;,
      &quot;@mui/material&quot;: &quot;^5.8.0&quot;,
      &quot;@mui/styles&quot;: &quot;^5.8.0&quot;,
      &quot;antd&quot;: &quot;^4.20.6&quot;,
      &quot;axios&quot;: &quot;^0.27.2&quot;,
      &quot;formik&quot;: &quot;^2.2.9&quot;,
      &quot;mime-types&quot;: &quot;^2.1.35&quot;,
      &quot;moment&quot;: &quot;^2.29.3&quot;,
      &quot;react&quot;: &quot;^18.1.0&quot;,
      &quot;react-dom&quot;: &quot;^18.1.0&quot;,
      &quot;react-csv&quot;: &quot;^2.2.2&quot;,
      &quot;react-draggable&quot;: &quot;^4.4.5&quot;,
      &quot;react-scripts&quot;: &quot;^5.0.1&quot;,
      &quot;react-table&quot;: &quot;^7.8.0&quot;,
      &quot;react-window&quot;: &quot;^1.8.7&quot;,
      &quot;spelling&quot;: &quot;^2.0.2&quot;,
      &quot;yup&quot;: &quot;^0.32.11&quot;
    },
    &quot;peerDependencies&quot;: {
      &quot;react&quot;: &quot;^16.8.0 || ^17.0.0&quot;,
      &quot;react-dom&quot;: &quot;^16.8.0 || ^17.0.0&quot;
    }
  }
  
  </code></pre>