Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to resolve module fs from node_modules\dotenv\lib\main.js: fs could not be found within the project. #260

Closed
RevatiPatil-123 opened this issue Dec 2, 2021 · 3 comments
Assignees

Comments

@RevatiPatil-123
Copy link

Building JavaScript bundle: error
ERROR
11:36
Unable to resolve module fs from node_modules\dotenv\lib\main.js: fs could not be found within the project.

If you are sure the module exists, try these steps:

  1. Clear watchman watches: watchman watch-del-all
  2. Delete node_modules and run yarn install
  3. Reset Metro's cache: yarn start --reset-cache
  4. Remove the cache: rm -rf /tmp/metro-*
    22 | */
    23 |

24 | const fs = require('fs')
| ^
25 | const path = require('path')
26 | const os = require('os')

The above error I am getting when I am trying to run the app in expo.

The dependencies are as below....

package.json file
{
"main": "node_modules/expo/AppEntry.js",
"scripts": {
"start": "expo start",
"android": "expo start --android",
"ios": "expo start --ios",
"web": "expo start --web",
"eject": "expo eject"
},
"dependencies": {
"@aws-amplify/ui-react": "^1.2.15",
"@aws-amplify/ui-vue": "^1.1.11",
"@fortawesome/react-fontawesome": "^0.1.15",
"@material-ui/core": "^4.12.3",
"@material-ui/icons": "^4.11.2",
"@react-native-async-storage/async-storage": "^1.15.7",
"@react-native-community/masked-view": "^0.1.10",
"@react-native-community/netinfo": "^6.0.2",
"@rpldy/native-uploady": "^0.13.6",
"aws-amplify": "^4.2.11",
"aws-amplify-react-native": "^5.0.3",
"aws-sdk": "^2.1013.0",
"dotenv": "^10.0.0",
"expo": "^41.0.0",
"expo-file-system": "^1.0.0",
"expo-status-bar": "~1.0.4",
"react": "16.13.1",
"react-dom": "16.13.1",
"react-native": "https://github.com/expo/react-native/archive/sdk-41.0.0.tar.gz",
"react-native-aws3": "0.0.9",
"react-native-build": "^1.0.7",
"react-native-document-picker": "^7.1.0",
"react-native-dropdown-menu": "^2.0.0",
"react-native-element-dropdown": "^1.4.4",
"react-native-fs": "^2.18.0",
"react-native-gesture-handler": "^1.10.3",
"react-native-image-picker": "^4.1.1",
"react-native-material-dropdown": "^0.11.1",
"react-native-really-awesome-button": "^1.6.0",
"react-native-reanimated": "^2.1.0",
"react-native-safe-area-context": "^3.2.0",
"react-native-screens": "~3.0.0",
"react-native-select-dropdown": "^1.2.0",
"react-native-shadow-cards": "^1.0.2",
"react-native-unimodules": "^0.15.0",
"react-native-web": "^0.17.1",
"react-native-webview": "^11.14.1",
"react-navigation": "^4.4.4",
"react-navigation-stack": "^2.10.4"
},
"devDependencies": {
"@babel/core": "^7.9.0"
},
"private": true
}

app.json file
{
"expo": {
"name": "project",
"slug": "project",
"version": "1.0.0",
"orientation": "portrait",
"icon": "./assets/icon.png",
"splash": {
"image": "./assets/splash.png",
"resizeMode": "contain",
"backgroundColor": "#ffffff"
},
"updates": {
"fallbackToCacheTimeout": 0
},
"assetBundlePatterns": [
"**/*"
],
"ios": {
"supportsTablet": true
},
"android": {
"adaptiveIcon": {
"foregroundImage": "./assets/adaptive-icon.png",
"backgroundColor": "#FFFFFF"
}
},
"web": {
"favicon": "./assets/favicon.png"
}
}
}

It is an urgent requirement
#239 #91

@github-actions
Copy link

github-actions bot commented Dec 2, 2021

Hey, thank you for opening this issue! 🙂 To boost priority on this issue and support open source please tip the team at https://issuehunt.io/r/goatandsheep/react-native-dotenv/issues/260

@goatandsheep
Copy link
Owner

Hi @RevatiPatil-123 I don't see this library installed as a devDependency. I highly recommend you check out the troubleshooting guides in the wiki section

@RevatiPatil-123
Copy link
Author

@goatandsheep ok sir I will check it thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants