jprichardson / node-fs-extra

Node.js: extra methods for the fs object like copy(), remove(), mkdirs()
MIT License
9.44k stars 776 forks source link

Counldn't find 'fs' module in both graceful-fs and jsonfile #993

Closed Mimiokish closed 1 year ago

Mimiokish commented 1 year ago

Version - Operating System: Windows 11 Version - Node.js: 14.19.1 Version - fs-extra: 11.1.1 Version - @types/fs-extra: 11.0.1 Version - Webpack: 5.75.0 Version - Webpack-cli: 5.0.1 Version - Typescript: 4.9.5 Version - eslint: 8.33.0

This package seems not working with webpack 5. Here is the error I got: Screenshot_20230201100313

This is a brand new project. Here is what I put down in my index.ts file: import fs from 'fs-extra' console.log(333, fs)

And, that is all the code I have for the project.

Webpack 5 removed support for node code modules. So I was trying to use fs-extra to get around it.

RyanZim commented 1 year ago

Why are you using webpack? Are you compiling for Electron, a browser, or what?

Mimiokish commented 1 year ago

It's for my web project.

RyanZim commented 1 year ago

fs-extra is for Node; it doesn't work on the web.