Error: Module not found: Error: Can't resolve 'fs'
Add the following to the root of the "package.json" file.
"browser": {
"fs": false,
"path": false,
"os": false
}
Error: Module not found: Error: Can't resolve 'fs'
Add the following to the root of the "package.json" file.
"browser": {
"fs": false,
"path": false,
"os": false
}
Error: Can't resolve 'fs' webpack
node: {
fs: 'empty'
}
could not resolve module fs react native
npm install rn-nodeify
Then in package.json file, add the following line in "scripts" to specify which modules you want to include in your RN project. For example, I used fs, crypto and https, and the line goes
"postinstall": "node_modules/.bin/rn-nodeify --install crypto,fs,https --hack"
node require fs not found
module.exports = {
webpack: (config, { isServer }) => {
// Fixes npm packages that depend on `fs` module
if (!isServer) {
config.node = {
fs: 'empty'
}
}
return config
}
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us