无法安装反应导航({react native})

时间:2018-09-13 04:49:32

标签: react-native

无法安装反应导航,错误如下,

   F:\Test2>npm install --save react-navigation
    npm WARN @babel/plugin-check-constants@7.0.0-beta.38 requires a peer of @babel/core@7.0.0-beta.38 but none is installed. You must install peer dependencies yourself.
    npm WARN react-native-screens@1.0.0-alpha.9 requires a peer of react@16.0.0-alpha.6 but none is installed. You must install peer dependencies yourself.
    npm WARN react-native-screens@1.0.0-alpha.9 requires a peer of react-native@^0.44.1 but none is installed. You must install peer dependencies yourself.
    npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules\fsevents):
    npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Error: EPERM: operation not permitted, rename 'F:\Test2\node_modules\.staging\fsevents-db169078\node_modules\nopt' -> 'F:\Test2\node_modules\.staging\nopt-ec00ee2d'

    npm ERR! path F:\Test2\node_modules\hoist-non-react-statics
    npm ERR! code ENOENT
    npm ERR! errno -4058
    npm ERR! syscall rename
    npm ERR! enoent ENOENT: no such file or directory, rename 'F:\Test2\node_modules\hoist-non-react-statics' -> 'F:\Test2\node_modules\.hoist-non-react-statics.DELETE'
    npm ERR! enoent This is related to npm not being able to find a file.
    npm ERR! enoent

    npm ERR! A complete log of this run can be found in:
    npm ERR!     C:\Users\usman\AppData\Roaming\npm-cache\_logs\2018-09-13T04_40_04_090Z-debug.log

任何帮助将不胜感激

2 个答案:

答案 0 :(得分:1)

第一次尝试

public class Main {

    public static void main(String[] args) {
        int[] arr1 = {1};
        double[] arr2 = {1.0};
        System.out.println(Test.identity(arr1));
        System.out.println(Test.identity(arr2));
    }
}

public class Test {
    public static <T extends Comparable<T>> T[] identity(T[] x) {
        return x;
    }
}

或下一个:

尝试安装

npm install -g react-navigation

首先备份节点模块中的所有依赖项。

获取有关npm install @react-navigation/native 的信息 使用此文件,您可以知道是否已经安装了哪些依赖项(如果需要),您可以重新安装npm,然后再次执行package.json

答案 1 :(得分:0)

似乎 <button class="btn btn-default btn-lg" onclick="ConfirmDialog('Are you sure you want To Download?')">Download</button> <br /><br /> <div id="overlay"> <div id="text"> <img src="~/assets/images/loadingimage.gif" style="width:5%;" /><span> &nbsp; Downloading....</span> </div> </div> <label class="error-msg" style="color:green;" itemid="lblmsg"></label> 软件包不正确。因此,您可以重新安装它或重新安装整个<script type="text/javascript"> function ConfirmDialog(message) { debugger; var x = window.confirm(message) debugger; if (x) { on(); $.ajax({ url: '@Url.Action("YourMVC_Method", "Controller")', type: 'GET', contentType: 'application/json;charset=utf-8', success: function (result) { debugger; $("label[itemid='lblmsg']").show(); $('label[itemid="lblmsg"]').text('DownloadSuccess'); off(); }, error: function (ex) { //alert(ex); $('label[itemid="lblmsg"]').hide(); off(); } }); } else { $('label[itemid="lblmsg"]').hide(); off(); } } function on() { document.getElementById("overlay").style.display = "block"; } function off() { document.getElementById("overlay").style.display = "none"; } </script>

首先,备份您的hoist-non-react-statics文件夹。这个非常重要! 然后删除node_modules文件夹,并用node_modules重新安装npm软件包。

完成上述操作后,尝试再次安装node_modules