im-js/im.js

下载了你的项目,跑不起来?

Lizhooh opened this issue · 15 comments

报这样的错误?怎么解决,貌似是 socket.io 那里的问题。

UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1762): UnableToRe
solveError: Unable to resolve module `G:\React-Native\im.js-master\node_modules\engine.io-client\lib\transports\index.j\lib\xmlhttprequest.js` from `G:\React-Native\im.js-master\node_modules\engine.io-client\l
Bundling `index.android.js`

你的 node 版本是多少,npm 用的是原生的嘛?

node v7.7.0 npm v4.1.2

npm 是用淘宝的源

@Lizhooh 试下 node-v7.6.0,删除 node_modules 文件夹,安装包的时候,使用
npm --registry=https://registry.npm.taobao.org install

试了很多种猜测,把 npm 的缓存也清空了。还是报同样的错误。难道是我的姿势不对?

Bundling `index.android.js`
  Transforming modules  ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░░░░░░░  75.5% (325/374)...(node:6928) UnhandledPromiseRejectionWarning: Unhandled pro
mise rejection (rejection id: 832): UnableToResolveError: Unable to resolve module `G:\React-Native\im.js-master\node_modules\engine.io-client\lib\transpor
ts\index.j\lib\xmlhttprequest.js` from `G:\React-Native\im.js-master\node_modules\engine.io-client\lib\transports\index.js`: Directory G:\React-Native\im.j
Bundling `index.android.js`
  Transforming modules  ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░  99.6% (447/448)...

@plusmancn 请问下你这个项目可以在真机跑起来吗?我也之前集成socket.io-client遇到了找不到node_modules\engine.io-client\lib\transports\index.j\lib\xmlhttprequest.js 这个文件的问题,模拟器是可以的,要跑到android真机上,先打包资源就遇到这个问题。

@yujinfu 可以额,项目主页直接提供 android apk 下载的,可以下载试试。

@Lizhooh 我 mac 上跑的,晚上我找台 windows 试下。

@plusmancn 你好 我刚刚扫码下载了你的apk,确实是可以
但是我下载了你的项目后,react-native run-android到真机 就报下面的错误
Bundling index.android.js
Bundling index.android.js
Bundling index.android.js
Bundling index.android.js
Transforming modules ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
▓░ 98.0% (481/486)...(node:43456) UnhandledPromiseRejectionWarning: Unhandled
promise rejection (rejection id: 881): UnableToResolveError: Unable to resolve m
odule F:\webstorm_workspace\im.js-master\node_modules\engine.io-client\lib\tran sports\index.j\lib\xmlhttprequest.js from F:\webstorm_workspace\im.js-master\n ode_modules\engine.io-client\lib\transports\index.js: Directory F:\webstorm_wor
kspace\im.js-master\node_modules\engine.io-client\lib\transports\index.j\lib\xml
Bundling index.android.js
Transforming modules ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
▓░ 99.6% (485/486)...

然后我采用先打包资源的方式,也遇到下面的问题

打包命令:
react-native bundle --platform android --dev false --entry-file index.android.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/
res/

Unable to resolve module F:\webstorm_workspace\im.js-master\node_modules\engine.io-client\lib\transports\index.j\lib\xmlhttprequest.js from F:\webstorm_workspace\im.js-master\node_modules\engine.io-client\lib\tran sports\index.js: Directory F:\webstorm_workspace\im.js-master\node_modules\engine.io-client\lib\transports\index.j\lib\xmlhttprequest.js doesn't exist

就还是报找不到node_modules\engine.io-client\lib\transports\index.j\lib\xmlhttprequest.js这个文件的错误
我看了下node_modules文件夹下engine.io-client 文件夹里面 transports里面只有index.js文件 没有index.j文件夹啊。。。不知道你的为什么可以,还请指教一下,谢谢。

@yujinfu 发现有问题的都是 windows,我是在 mac 上编译的。
抱歉,我没在 windows 上编译过,我这两天找个时间,看下 windows

@plusmancn 好的 多谢多谢,在这里等你在windows的编译结果。

@plusmancn 请问是否在windows编译成功 并且可以在手机跑起来了?

请问这个在windows编译通过了吗?怎么close了?

我也遇到一样的问题
99.6%

同样windows下

怀疑是npm的BUG
把一个.js的引用解析成了xxxxx.j/lib/xxxx.js了
对应的手动生成3个目录可以解决这问题,但不清楚原因