【问题标题】:Phonegap command line: www does not contain index.htmlPhonegap 命令行:www 不包含 index.html
【发布时间】:2013-07-29 11:20:05
【问题描述】:

我正在按照http://phonegap.com/install/上的程序进行操作

npm install -g phonegap

似乎工作正常,它在 AppData\Roaming\npm\node_modules\phonegap 下创建了一个 40+ Mb 文件夹

那么,

phonegap 创建我的应用程序

产生以下错误:

[错误] 在 C:\Users\.cordova\lib\www\phonegap\3 中下载了 www 资产 .0.0\www 不包含 index.html,或带有 index.html 的 www 子目录

我也尝试过这里的文档:http://docs.phonegap.com/en/3.0.0/guide_cli_index.md.html#The%20Command-line%20Interface

这就是发生的事情:

cordova 创建你好 com.example.hello HelloWorld [TypeError:无法读取未定义的属性“长度”]

您知道为什么会发生这种情况吗?谢谢

【问题讨论】:

    标签: cordova npm


    【解决方案1】:

    除了JeffC的回答,要摆脱下一个错误:

    cordova create hello com.example.hello HelloWorld [TypeError: Cannot read property 'length' of undefined]

    我还必须删除 ~/.profile

    中的旧代理设置(我忘记了)

    # 导出 http_proxy=url:@aproxy:portnumber

    【讨论】:

      【解决方案2】:

      我自己通过设置 https-Proxy 解决了这个问题:

      npm config set https-proxy http://<https-proxy-server>:<https-port>
      

      除了正常的代理设置:

      npm config set proxy http://<proxy-server>:<port>
      

      【讨论】:

        【解决方案3】:

        在适当的地方删除3.0.0目录:

        ~/.cordova/lib/www/phonegap (phonegap) 或 Windows 中的 phonegap 主目录

        ~/.cordova/lib/www/cordova (cordova) 或 Windows 中的 cordova 主目录

        然后尝试再次创建应用程序。

        【讨论】:

        • 对我来说效果很好。谢谢杰夫C
        • 我也使用过 Cordova 3.3.0。
        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2012-05-12
        • 2016-03-09
        • 2015-07-29
        • 2017-01-12
        • 1970-01-01
        • 1970-01-01
        • 2014-11-02
        相关资源
        最近更新 更多