Module build failed: Cannot find module 'fs/promises'
Error running Webpack5 with Babel: Cannot find module 'fs/promises'
few ways to resolve this issue:
- installing babel-loader version 8.0.4
- The problem is with the node.js older version.
- Delete your package-lock.json
- Delete node_modules folder
- Uninstall your node.js older version and Update to the latest node.js version by installing from the official site https://nodejs.org/en/download will solve the problem.
- Also check npm version, and update to latest npm version by using: npm install -g npm
- At the end also update all npm packages by: npm --force update This will update all packages in the package.json and installs latest packages.
command that can help:
npm ls webpack
npm uninstall webpack
npm install webpack@2.1.0-beta.25