在任何项目根目录

实际行为

从头开始反应本机项目时,我得到一个红色的屏幕和这个错误消息:无法在任何项目根目录[“/ Users / neo / newProjects / F2”中find条目文件index.ios.js]

预期的行为

启动一个干净的应用程序启动器

我正在尝试做什么

我试图在Android和ios模拟器从头开始并运行一个react-native项目,但是我得到以下错误。

我曾经尝试过

我已经尝试了以下操作:

通过文档安装

  • 浏览这里列出的几个安装步骤: https : //facebook.github.io/react-native/docs/getting-started.html

NPM安装

  • 从项目文件夹中执行NPM安装

编辑.profiles(android)

  • 编辑〜.profiles文件,设置android homevariables..这就是现在的样子:

export PATH="$PATH:$HOME/.rvm/bin" # Add RVM to PATH for scripting

[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" $

 export ANDROID_HOME=${HOME}/Library/Android/sdk export PATH=${PATH}:${ANDROID_HOME}/tools export PATH=${PATH}:${ANDROID_HOME}/platform-tools` 

Npm开始

运行npm启动并检查端口上的活动,(运行包pipe理器)

检查港口的活动

(忘记如何,validation其可用)

为某人工作的代码…

我也试着在terminal上运行这个代码

 react-native bundle \ --entry-file=index.ios.js \ --platform=ios \ --dev=false \ --assets-dest=./production/ios \ --bundle-output=./production/ios/ios.jsbundle 

在审查这篇文章后https://github.com/facebook/react-native/issues/8664

并得到这个错误信息:ENOENT:没有这样的文件或目录,打开'./production/ios/ios.jsbundle'

我注意到了这个build议

重新运行npm install和rnpm链接

我尝试运行rnpm链接,但得到“没有find这样的命令”

在阅读这篇文章之后,从包装者反应本地文件错误

在同一篇文章中我看到了这个:

“发现更新到RN 0.28后,我的应用程序因为不兼容的依赖关系而吐出了这个问题,这就是我解决这个问题的方法”

 rm -rf node_modules npm cache clean 

然后打开package.json,除了react-native将所有软件包版本更改为*

然后运行
npm update –save npm update –save-dev

如果package.json更新了版本号,检查包,如果不从npmjsvalidation并手动更新

从设备上删除应用程序并尝试再次运行

  • 但是我看不出这个顾问在做什么……以及这个背后的逻辑……如果看起来相关的话,有人可以评论这个吗?

terminal输出

我在terminal上得到这个:

 Loading dependency graph, done. error: bundling: Error at DependencyGraph._getAbsolutePath (/Users/neo/newProjects/F2/node_modules/react-native/packager/src/node-haste/index.js:272:11) at DependencyGraph.getDependencies (/Users/neo/newProjects/F2/node_modules/react-native/packager/src/node-haste/index.js:216:26) at Resolver.getDependencies (/Users/neo/newProjects/F2/node_modules/react-native/packager/src/Resolver/index.js:106:27) at _resolverPromise.then.resolver (/Users/neo/newProjects/F2/node_modules/react-native/packager/src/Bundler/index.js:561:62) at process._tickCallback (internal/process/next_tick.js:109:7) Bundling `index.ios.js` 0.0% (0/1), failed. 

版本

Node v7.9.0 react-native-cli:2.0.1 react-native:0.44.0 Homebrew 1.2.0刚更新了xcode OSX 10.11.6(15G1004)

我注意到了

我注意到它似乎是在这个文件中查找.. [“/ Users / neo / newProjects / F2”],而在我的机器上的某些位置的文件是组织用户/新/ …(资本用户名)…我觉得这与此有关。

另外,在项目构build它确实会抛出这个警告…不知道这意味着什么…“react-native@0.44.0”未得到满足的同行依赖“react@16.0.0-alpha.6”

任何build议或想法?

更新

尝试更改用户文件夹和初始化的目录

这是我在堆栈跟踪中得到的

 2017-05-02 09:25:21.478 xcodebuild[52491:5334564] Error saving log: Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory" UserInfo={NSFilePath=/code/F4/ios/build/Logs/Build/B9E13558-CCE5-4451-AC21-7E643189BF7B.xcactivitylog, NSLocalizedDescription=No such file or directory} | User info: { NSFilePath = "/code/F4/ios/build/Logs/Build/B9E13558-CCE5-4451-AC21-7E643189BF7B.xcactivitylog"; NSLocalizedDescription = "No such file or directory"; 

}

  Installing build/Build/Products/Debug-iphonesimulator/F4.app An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=2): Failed to install the requested application An application bundle was not found at the provided path. Provide a valid path to the desired application bundle. Print: Entry, ":CFBundleIdentifier", Does Not Exist Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier build/Build/Products/Debug-iphonesimulator/F4.app/Info.plist Print: Entry, ":CFBundleIdentifier", Does Not Exist 

另外,尝试安装世博会,并从那里运行…

下面是terminal显示Error sourcing shell startup scripts: /Users/neo/.bash_profile: line 2: rbenv: command not found /Users/neo/.bash_profile: line 4: rbenv: command not found /Users/neo/.bash_profile: line 5: rbenv: command not found /Users/neo/.bash_profile: line 7: rbenv: command not found /Users/neo/.bash_profile: line 9: rbenv: command not found /bin/bash: shell_session_update: command not found . 请运行npm install -g exp && exp path`` 10:25:22 AM Starting React Native packager... 10:25:31 AM Scanning 656 folders for symlinks in /code/my-new-project/node_modules (11ms) 10:25:32 AM Loading dependency graph. 10:25:32 AM Running packager on port 19001. 10:25:32 AM 10:25:37 AM Dependency graph loaded. 10:25:51 AM Project opened! You can now use the "Send Link" or "Device" buttons to view your project. 10:36:58 AM Couldn't start project on Android: could not install *smartsocket* listener: Address already in use ADB server didn't ACK * failed to start daemon * error: cannot connect to daemon npm install -g exp && exp path`` 10:25:22 AM Starting React Native packager... 10:25:31 AM Scanning 656 folders for symlinks in /code/my-new-project/node_modules (11ms) 10:25:32 AM Loading dependency graph. 10:25:32 AM Running packager on port 19001. 10:25:32 AM 10:25:37 AM Dependency graph loaded. 10:25:51 AM Project opened! You can now use the "Send Link" or "Device" buttons to view your project. 10:36:58 AM Couldn't start project on Android: could not install *smartsocket* listener: Address already in use ADB server didn't ACK * failed to start daemon * error: cannot connect to daemon npm install -g exp && exp path`` 10:25:22 AM Starting React Native packager... 10:25:31 AM Scanning 656 folders for symlinks in /code/my-new-project/node_modules (11ms) 10:25:32 AM Loading dependency graph. 10:25:32 AM Running packager on port 19001. 10:25:32 AM 10:25:37 AM Dependency graph loaded. 10:25:51 AM Project opened! You can now use the "Send Link" or "Device" buttons to view your project. 10:36:58 AM Couldn't start project on Android: could not install *smartsocket* listener: Address already in use ADB server didn't ACK * failed to start daemon * error: cannot connect to daemon `