在任何软件包安装上React Native新鲜项目中断

时间:2017-12-18 17:05:45

标签: node.js reactjs react-native npm expo

大约一年前我和React Native合作过,从那以后很多事情都发生了很大变化。安装模块过去很简单,但现在我似乎无法在没有完全破坏项目的情况下安装任何东西。我在Expo XDE下创建了一个新项目并为其命名。在创建之后,我通过在IOS上加载它来确保它正常工作并获得典型的“欢迎和打开App.js”。到现在为止还挺好。然后我希望安装一个抽屉组件。所以我去JS.coach并选择我认为合适的模块(https://js.coach/react-native-drawer-layout?search=drawer&collection=React+Native)。在此之后,我做了第一件事,enter image description here

在运行NPM安装后,它显然会卸载大约700个软件包,我认为这是一切都中断的地方。但我无法弄清楚过去做了什么或如何解决它。我之后运行了NPM install react-native,并且尝试仅使用yarn包管理器获得相同的结果。这是由于我的项目设置还是由于NPM内的防火墙设置?无论哪种方式,我都知道添加模块不应该这么难,因此,我知道我必须主要忽视某些事情。 (我知道cmd屏幕截图使用了不同的软件包,仅用于跨不同软件包展示)enter image description here

然而令我感到困惑的是,它似乎说隧道存在问题并拒绝连接。

<td is="car-component">

有谁知道我做错了什么?

<!doctype html5>
<html>
    <head>
        <style type="text/css">

        strong { font-weight: bold; }
        hr { -moz-box-sizing: content-box; box-sizing: content-box; height: 0; }
        html { font-family: sans-serif;   -ms-text-size-adjust: 100%;   -webkit-text-size-adjust: 100%;   } body { margin: 0; }
        a { background-color: transparent; }
        a:active, a:hover { outline: 0; }
        </style>

        <style type="text/css">
            body { background-color: #f5f5f5; }
            .container { width: 500px; margin: auto; color: #444; padding: 5px; }
            a, strong { color: purple; text-decoration: none; }
            a:hover { text-decoration: underline; }
            h2 { text-align: center; color: #000; }
            p { line-height: 20px; }
        </style>
    </head>
    <body>
        <div class="container">


<h2>Failed to complete tunnel connection</h2>
<hr />
<p>
    The connection to <strong><a href="http://packager.ak-gj5.ae.rf-ink.exp.direct">http://packager.ak-gj5.ae.rf-ink.exp.direct</a></strong>
    was successfully tunneled to your ngrok client,
    but the client failed to establish a connection to
    the local address <strong><a href="http://localhost:19001">localhost:19001</a></strong>.
</p>
<p>
    Make sure that a web service is running on
    <strong><a href="http://localhost:19001">localhost:19001</a></strong> and that it is a valid address.
</p>
<p>
    The error encountered was: <strong style="color: #9E2929">dial tcp [::1]:19001: connectex: No connection could be made because the target machine actively refused it.</strong>
</p>


        </div>
    </body>
</html>


ABI23_0_0RCTFBQuickPerformanceLoggerConfigureHooks
ABI24_0_0RCTFBQuickPerformanceLoggerConfigureHooks
<redacted>
<redacted>
<redacted>
<redacted>
<redacted>
CFRunLoopRunSpecific
GSEventRunModal
UIApplicationMain
Exponent
<redacted>

2 个答案:

答案 0 :(得分:0)

尝试不通过Expo,但创建一个同时包含iOS和Android项目的项目。

答案 1 :(得分:0)

使用export const plotPoint = function (path) { var ns = 'http://www.w3.org/2000/svg'; var x, y = 1; path.map(function (value, index) { var coordinates = value.split(','); x = parseInt(coordinates[0], 10); y = parseInt(coordinates[1], 10); var startCircle = document.createElementNS(ns, 'circle'); startCircle.setAttributeNS(null, 'cx', x); startCircle.setAttributeNS(null, 'cy', y); startCircle.setAttributeNS(null, 'r', 1); startCircle.setAttributeNS(null, 'fill', 'green'); document.querySelector("#map").append(startCircle); }); } 代替yarn add。我不是100%使用react-native但是使用create-react-app创建React应用程序时遇到了类似的问题,我通过使用npm install来解决这个问题

相关问题