无法在任何项目根目录中找到条目文件index.ios.js [“/ Users / neo / newProjects / F2”]

时间:2017-05-02 07:51:06

标签: android ios react-native

实际行为

而不是启动,我从头开始启动一个反应本机项目时出现红屏和此错误消息:无法在任何项目根目录中查找条目文件index.ios.js [“/ Users / neo / newProjects / F2 “]

预期行为

推出一款干净的app启动器

我想做什么

我正在尝试在android和ios模拟器中初始化并从头开始运行一个react-native项目,但是我收到以下错误。

我尝试了什么

我尝试过以下操作:

通过文档安装

NPM安装

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

编辑.profiles(android)

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

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 start并检查端口上的活动(包管理器是否正在运行)

检查端口是否有活动

(忘记如何,验证其可用)

为某人工作的代码......

我也尝试在终端中运行此代码

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'

我注意到了这个建议

重新运行npm install和rnpm链接

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

阅读本文后 Entry file error in react native from packager

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

“想到更新到RN 0.28之后我的应用程序由于不兼容的依赖性而吐出这个问题。这就是我解决这个问题的方法”

rm -rf node_modules
npm cache clean

然后打开package.json,except-native将所有包版本更改为*

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

检查包是否使用版本号更新package.json,如果不是从npmjs验证并手动更新

从设备中删除应用并尝试重新运行

  • 但是我无法分辨顾问在这里做了什么......以及它背后的逻辑......如果看起来相关,有人会对此发表评论吗?

终端输出

我在终端得到这个:

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.

版本

节点v7.9.0 react-native-cli:2.0.1 反应原生:0.44.0 自制1.2.0 刚刚更新了xcode OSX 10.11.6(15G1004)

我注意到了什么

我注意到它似乎正在查看此文件.. [“/ Users / neo / newProjects / F2”]而在我的机器上的某些位置文件是有组织的Users / Neo / ...(大写用户名) ......我觉得这与此有关。

另外,在项目构建中它确实抛出了这个警告......不确定它意味着什么......     “react-native@0.44.0”有未满足的同伴依赖“react@16.0.0-alpha.6”

有任何建议或想法吗?

更新

尝试将目录更改为用户文件夹并初始化

这是我在stacktrace中得到的东西

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

另外,尝试安装expo并从那里运行......

这是终端显示的内容 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 `

0 个答案:

没有答案