简体   繁体   English

在Macbook上运行react-native项目时出现路径错误

[英]Path error when running react-native project on my macbook

It is a path error, but I never modify file. 这是路径错误,但我从不修改文件。

The file exists. 该文件存在。 My project path is '../test'. 我的项目路径是'../test'. test folder is my project root dir. 测试文件夹是我的项目root dir. but the err msg tell me the root is 'test/node_modules/react-native/packager'; 但是err msg告诉我根目录是'test/node_modules/react-native/packager'; , It is wrong. , 这是错误的。

I think the project config is wrong, but I don't know how to modify config. 我认为项目配置错误,但我不知道如何修改配置。

在此处输入图片说明

The issue is that you don't have a index.ios.js file, so it can't run the thing. 问题是您没有index.ios.js文件,因此无法运行该文件。 You would have the same issue if you ran a Android simulator and didn't have index.android.js. 如果您运行Android模拟器并且没有index.android.js,则会遇到相同的问题。 If your react app is in the App.js file: 如果您的react应用位于App.js文件中:

cp App.js index.ios.js

in your react project folder. 在您的反应项目文件夹中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在React-Native项目上开玩笑时出错 - Error when running jest on React-Native project 错误在React-Native中编译项目时无法执行aapt - Error Failed to execute aapt, when compiling project in React-Native 尝试安装 react-native 项目时出错 - Error when try to install react-native project 在我的 m1 macbook 设备上初始化 react-native 应用程序时,它在下载包时出现 cocapods 错误 - While initializing react-native app on my m1 macbook device it gives cocapods error while downloading packages 当我使用“react-native run-ios”运行 React Native 项目时显示错误 - React Native project showing error when I run it using "react-native run-ios" 在对本机项目运行声纳分析时,得到与sonar.java.binaries属性相关的错误 - On running sonar analysis on react-native project getting error related to sonar.java.binaries property 初始化本机项目时出现“错误监视文件的更改:EMFILE” - “Error watching file for changes: EMFILE” when init a react-native project 我可以在我的博览会项目中运行 react-native 链接吗? - Can I run react-native link in my expo project? 在我的本机项目中使用json文件 - Use a json file in my react-native project 如何从我的 react-native 项目构建 android apk? - How to build android apk from my react-native project?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM