Home > Article > Web Front-end > What should I do if fs reports an error when webpack packages node?
Solution to the fs error when webpack packages node: 1. Install the babel packaging tool in the Webpack project; 2. Check the packaging failure information; 3. Directly uninstall the original Nodejs and re-download the stable Node version; 4. Use prefetch to cache the js modules to be used in advance.
#The operating environment of this tutorial: Windows 10 system, node v10.16.0 version, Dell G3 computer.
What should I do if fs reports an error when webpack packages node?
Webpack problem record solutionError: Cannot find module 'node:fs/promises'
After installing the babel packaging tool in the Webpack project, the packaging failed and Error: Cannot find module ' node:fs/promises'
:
ERROR in ./src/index.js Module build failed (from ./node_modules/babel-loader/lib/index.js):Error: Cannot find module 'node:fs/promises'
I tried many solutions on the Internet and said cnpm The wrong version, etc., but to no avail.
Final solution: Just uninstall the original Nodejs and download the latest stable Node version to solve the problem.
[webpack-cli] Error: Conflict: Multiple chunks emit assets to the same filename main.js (chunks main and vendors-node_modules_core-js_modules_es6_function_bind_js-node_modules_core-js_modules_es6_ob-dc6264)
Conflict: Multiple chunks Send assets to the same file name main.js
Change the output filename to Automatically modify by name.
output: { path: path.join(__dirname, '../dist'), filename: '[name].js'},
Use prefetch to cache the js module to be used in advance.
Show prefetch catch.
Recommended learning: "node.js Video Tutorial"
The above is the detailed content of What should I do if fs reports an error when webpack packages node?. For more information, please follow other related articles on the PHP Chinese website!