来自packager的本地反应中的条目文件错误

时间:2016-06-23 18:44:48

标签: react-native

我正在尝试运行一个本机反应项目,该项目在其他人的计算机上运行良好,但我收到了以下错误。我尝试过以下操作:

  • 清理安装节点,npm
  • 重新运行npm install和rnpm link

似乎路径字符串被更改为"全局代码@ http://localhost:8081/index.ios.js",但它们在配置文件中看起来很好。

Looking for JS files in
   /Users/dennisjeong/mobile-bebop/bebopRecruitMobile 

[11:15:00 AM] <START> Building Dependency Graph
[11:15:00 AM] <START> Crawling File System
[Hot Module Replacement] Server listening on /hot

React packager ready.

[11:15:05 AM] <START> request:/index.ios.bundle?platform=ios&dev=true
[11:15:05 AM] <START> find dependencies
[11:15:20 AM] <END>   Crawling File System (19327ms)
[11:15:20 AM] <START> Building in-memory fs for JavaScript
[11:15:20 AM] <END>   Building in-memory fs for JavaScript (213ms)
[11:15:20 AM] <START> Building in-memory fs for Assets
[11:15:20 AM] <END>   Building in-memory fs for Assets (153ms)
[11:15:20 AM] <START> Building Haste Map
[11:15:20 AM] <START> Building (deprecated) Asset Map
[11:15:20 AM] <END>   Building (deprecated) Asset Map (66ms)
[11:15:20 AM] <END>   Building Haste Map (166ms)
[11:15:20 AM] <END>   Building Dependency Graph (19867ms)
transformed 726/726 (100%)
[11:15:21 AM] <END>   find dependencies (16307ms)
[11:15:21 AM] <END>   request:/index.ios.bundle?platform=ios&dev=true (16406ms)
[11:15:21 AM] <START> symbolicate
[11:15:21 AM] <START> find dependencies
[11:15:21 AM] <START> find dependencies
transformed 726/726 (100%)
[11:15:22 AM] <END>   find dependencies (498ms)
NotFoundError: Cannot find entry file global code@http://localhost:8081/index.ios.js in any of the roots: ["/Users/dennisjeong/mobile-bebop/bebopRecruitMobile"]
    at DependencyGraph._getAbsolutePath (/Users/dennisjeong/mobile-bebop/bebopRecruitMobile/node_modules/node-haste/lib/index.js:288:13)
    at /Users/dennisjeong/mobile-bebop/bebopRecruitMobile/node_modules/node-haste/lib/index.js:226:30
    at process._tickCallback (internal/process/next_tick.js:103:7)
[11:15:22 AM] <END>   symbolicate (511ms)
[11:15:22 AM] <START> symbolicate
[11:15:22 AM] <END>   symbolicate (341ms)

1 个答案:

答案 0 :(得分:2)

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

rm -rf node_modules npm cache clean

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

然后跑 npm update --save npm update --save-dev

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

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