请问这个模块能用于react-native中么?
geminiblue opened this issue · 2 comments
在react-native项目中npm install了hprose,然后照着例子加了一个client,然后就报以下错误了,
把url,events,http,https 全部install一边还是老样子
Unable to resolve module http from /Users/xxx/works/myapp/node_modules/hprose/lib/client/HttpClient.js: Module does not exist in the module map or in these directories:
/Users/xxx/works/myapp/node_modules
This might be related to facebook/react-native#4968
To resolve try the following:
- Clear watchman watches:
watchman watch-del-all
. - Delete the
node_modules
folder:rm -rf node_modules && npm install
. - Reset packager cache:
rm -fr $TMPDIR/react-*
ornpm start -- --reset-cache
.
RCTFatal + 104
-[RCTBatchedBridge stopLoadingWithError:] + 1138
__25-[RCTBatchedBridge start]_block_invoke_2 + 65
_dispatch_call_block_and_release + 12
_dispatch_client_callout + 8
_dispatch_main_queue_callback_4CF + 1054
CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE + 9
__CFRunLoopRun + 2205
CFRunLoopRunSpecific + 420
GSEventRunModal + 161
UIApplicationMain + 159
main + 111
start + 1
0x0 + 1
如果你只是需要客户端,你可以试试:hprose-js 或者 hprose-html5 这两个项目。这两个是为浏览器和 Hybird app 专门提供的,不依赖任何 nodejs 模块的,但是同样可以使用 npm install 来安装。
如果可以的话,请反馈一下,谢谢。