反应原生TCP指南问题。 “对象原型可能只是一个Object或null。”当做var net = require('net');

时间:2017-02-06 08:28:06

标签: react-native tcpsocket

我正在关注在反应原生中使用tcp套接字的this指南。我遵循了所有步骤,但是当我跑步时,我得到了this error

问题在于这一行:

    var net = require('net');

这是我的package.json

{
 "name": "MyTCP",
 "version": "0.0.1",
 "private": true,
 "scripts": {
 "start": "node node_modules/react-native/local-cli/cli.js start",
 "test": "jest",
 "postinstall": "rn-nodeify --install stream,process,util --hack"
 },
 "dependencies": {
 "process": "^0.11.0",
 "react": "15.4.2",
 "react-native": "0.41.1",
 "react-native-tcp": "^3.2.0",
 "readable-stream": "^1.0.33",
 "stream-browserify": "^1.0.0"
 },
 "devDependencies": {
 "babel-jest": "18.0.0",
 "babel-preset-react-native": "1.9.1",
  "jest": "18.1.0",
  "react-test-renderer": "15.4.2",
  "rn-nodeify": "^7.0.1"
  },
  "jest": {
 "preset": "react-native"
  },
  "react-native": {
 "net": "react-native-tcp",
 "_stream_transform": "readable-stream/transform",
 "_stream_readable": "readable-stream/readable",
 "_stream_writable": "readable-stream/writable",
 "_stream_duplex": "readable-stream/duplex",
 "_stream_passthrough": "readable-stream/passthrough",
 "stream": "stream-browserify"
 },
"browser": {
 "net": "react-native-tcp",
 "_stream_transform": "readable-stream/transform",
 "_stream_readable": "readable-stream/readable",
 "_stream_writable": "readable-stream/writable",
 "_stream_duplex": "readable-stream/duplex",
 "_stream_passthrough": "readable-stream/passthrough",
 "stream": "stream-browserify"
}
}

我在Android设备上运行Windows 10。

0 个答案:

没有答案