Monday, May 13, 2024
 Popular · Latest · Hot · Upcoming
61
rated 0 times [  64] [ 3]  / answers: 1 / hits: 8088  / 4 Years ago, mon, november 9, 2020, 12:00:00

#node_modules/expo/AppEntry.js: [BABEL]



I already installed all the dependencies for my project, and I'm getting this issue, and I'm not sure how to solve it.


#package.json - Main


{
"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": {
"babel": "^6.23.0",
"expo": "~39.0.2",
"expo-status-bar": "~1.0.2",
"react": "16.13.1",
"react-dom": "16.13.1",
"react-native": "https://github.com/expo/react-native/archive/sdk-39.0.4.tar.gz",
"react-native-dotenv": "^2.4.2",
"react-native-web": "~0.13.12"
},
"devDependencies": {
"@babel/core": "~7.9.0",
"babel-plugin-module-resolver": "^4.0.0"
},
"private": true,
"name": "my-project"
}

enter


More From » reactjs

 Answers
3

Checked your GitHub repo, as pointed out by byCedric, your Problem was with dependencies that you were using. I made the following changes and the app appears to be working,


Screenshot:


enter


package.json


{
"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": {
"@react-native-community/picker": "^1.6.6",
"expo": "~39.0.2",
"expo-status-bar": "~1.0.2",
"react": "16.13.1",
"react-dom": "16.13.1",
"react-native": "https://github.com/expo/react-native/archive/sdk-39.0.4.tar.gz",
"react-native-dotenv": "^2.4.2",
"react-native-fs": "^2.16.6",
"react-native-web": "~0.13.12"
},
"devDependencies": {
"@babel/core": "~7.9.0"
},
"private": true
}

after installing all the dependencies mentioned above, I faced two more issues with the following files:



  1. node_modulesdotenvlibmain.js

  2. node_modulesreact-native-dotenvindex.js


They were using Node standard library module "fs" , so I replaced it with react-native-fs package in both the above files.


both files after modifying:


//node_modulesdotenvlibmain.js

const fs = require("react-native-fs")
const path = require('path')

function log (message /*: string */) {
console.log(`[dotenv][DEBUG] ${message}`)
}
...


// node_modulesreact-native-dotenvindex.js
const {readFileSync} = require("react-native-fs")
const dotenv = require('dotenv')

function parseDotenvFile(path, verbose = false) {
let content
...

also there was a typo in the WeatherDetails.js, you passed unitSystem instead of unitsSystem as a props


[#2338] Wednesday, November 4, 2020, 4 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
jarettajb

Total Points: 678
Total Questions: 94
Total Answers: 90

Location: Guernsey
Member since Tue, Jul 6, 2021
3 Years ago
jarettajb questions
;