javascript - how to solve the error that fs module is not found when used node.js -


this question has answer here:

i want use mongodb in app uses webpack , react,but has error:"module not found:error:can't resolve 'fs' in f:\nodespace\react\react-app\node_modules\mongo\lib\gridfs",then try use fs module in cmd system,and works,and try use fs module in app,it showes error: "module not found:error:can't resolve 'fs' in f:\nodespace\react\react-app\app".

it's appreciate can me solve it.

just add below lines in webpack config file.

node: {     fs: "empty"  } 

for more reference


Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -