I type the command in cmd: npx create-expo-app loginHAT when creating the project in the loginHAT folder there is no App.js file? How to fix this error ?
Loading
I type the command in cmd: npx create-expo-app loginHAT when creating the project in the loginHAT folder there is no App.js file? How to fix this error ?
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Jayraj ChhayaRank #304 · 8.2K reputationPosted May 8, 2024, 5:33 AM EDT
When using Expo CLI to create a React Native project, the default entry point file is
App.js. If the file is missing after project creation, it might be due to a version mismatch or an issue during project initialization.To fix this error, you can manually create the
App.jsfile in the project directory. Here is an example of how you can create a basicApp.jsfile:import React from 'react'; import { Text, View } from 'react-native'; const App = () => { return ( Welcome to My React Native App! ); }; export default App;After creating the
App.jsfile, make sure to run the project again to see if the issue is resolved. If the problem persists, consider updating Expo CLI or checking for any installation errors during project setup.Naimish MakwanaRank #324 · 7.7K reputationPosted May 8, 2024, 5:55 AM EDT
The command you’re using
npx create-expo-app loginHATis for creating a new Expo project. However, starting from Expo SDK 41, the main application file is no longerApp.js, butApp.tsxinstead. This is because Expo has moved to TypeScript for the main application file.If you’re looking for the
App.jsfile, you might want to check forApp.tsxinstead. If you want to use JavaScript instead of TypeScript, you can renameApp.tsxtoApp.jsand adjust the code accordingly.Here’s a basic
App.jscontent you can start with if you don’t have one:import React from 'react'; import { Text, View } from 'react-native'; export default function App() { return ( Hello, world! ); }You can replace the content of
App.tsxwith the above code after renaming it toApp.js. Remember to install all the necessary dependencies and runexpo startto start your Expo app.Thanks
Dong Lam TrienRank #1,537 · 1K reputationPosted May 8, 2024, 9:52 PM EDT
Before, I still used the command: npx create-expo-app newproject to create the project, in the project folder there was App.js, now I use it again without the App.js or App.tsx file, I don't know. What is the error that the App.js file cannot be created? Please see the attached image file