2017-05-29 72 views
1

我想用我的ignitereact-native-autobahnjs使用WAMP反应本地的项目,而我得到的是一个错误:在反应母语

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 

什么导致此?我的node_modules内有ws/lib

在反应本机应用程序中使用WAMP的任何替代方案?

+0

它看起来像你有错误的路径或错误的模块名称。 – KimHau

回答

0

React-Native里面没有nodejs服务器,所以你不能访问大多数节点模块。您可以安装没有依赖关系的模块。

Autobahn-js通过移除它的所有依赖项(crypto-js,when,ws,msgpack-lite)并移植到es6样式代码中移植。 现在,它在react-native和web浏览器中工作,但不在nodejs(需要ws)中工作,并且只支持json协议。 https://github.com/webee/wamp.js