我试图在我的ignite react原生项目中使用react-native-autobahnjs,但得到的结果是一个错误:
Unable to resolve module 'url' from 'mypaths/node_modules/ws/lib/WebSocket.js': Module does not exist in the module map or in these directories mypaths/node_modules/ws/node_modules, mypaths/node_modules这可能是什么原因造成的?我把ws/lib放在我的node_modules里。
有什么替代方案可以在react原生应用中使用WAMP吗?
发布于 2017-06-28 23:34:50
React-Native内部没有nodejs服务器,因此您无法访问大多数节点模块。您可以安装模块,这些模块没有依赖项。
Autobahn-js通过移除所有依赖项(crypto-js,when,ws,msgpack-lite)进行移植,并转换为es6风格的代码。现在,它可以在react-native和web浏览器中工作,但不能在nodejs(需要ws)中工作,并且只支持json协议。https://github.com/webee/wamp.js
https://stackoverflow.com/questions/44249773
复制相似问题