2016-06-23 20 views
5

Tôi đang cố chạy một dự án phản ứng gốc, hoạt động tốt trên các máy của người khác, nhưng tôi nhận được lỗi sau. Tôi đã thử làm như sau:Lỗi tệp nhập trong phản ứng gốc từ packager

  • sạch cài đặt của nút, NPM
  • chạy lại NPM cài đặt và liên kết rnpm

nó có vẻ như chuỗi con đường đã được đổi thành "mã toàn cầu @http://localhost:8081/index.ios.js ", nhưng chúng trông ổn trong các tập tin cấu hình.

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 [email protected]://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) 

Trả lời

2

Đã phát hiện ra rằng sau khi cập nhật lên RN 0,28, ứng dụng của tôi đang loại bỏ vấn đề này do phụ thuộc không tương thích. Đây là cách tôi giải quyết vấn đề này

rm -rf node_modules npm cache clean

Sau đó mở package.json trừ thay đổi tất cả các phiên bản gói phản ứng-nguồn gốc *

Sau đó chạy npm update --save npm update --save-dev

Kiểm tra gói nếu gói. json được cập nhật với số phiên bản, nếu không xác minh từ npmjs và cập nhật thủ công

Xóa ứng dụng từ thứ thiết bị điện tử và cố gắng chạy lại

Các vấn đề liên quan