【问题标题】:Phonegap error: Cannot find modulePhonegap 错误:找不到模块
【发布时间】:2015-06-08 13:37:18
【问题描述】:

我正在尝试创建一个 HelloWorld 项目,但遇到错误

phonegap create C:\Desenv\PhoneGap\learn com.cassia.hello HelloWorld

错误:

C:\Users\cassiasantos>phonegap create teste com.cassia.hello HelloWord
module.js:338
    throw err;
          ^
Error: Cannot find module '..\..\node_modules\cordova\node_modules\cordova-lib'
    at Function.Module._resolveFilename (module.js:336:15)
    at Function.Module._load (module.js:278:25)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at Object.<anonymous> (C:\Users\cassiasantos\AppData\Roaming\npm\node_module
s\phonegap\lib\cordova\index.js:16:26)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)

【问题讨论】:

    标签: cordova phonegap-plugins


    【解决方案1】:

    看来您必须安装所有模块 - 至少这个修复对我有用。

    使用

    sudo npm update -g
    

    ionic forum 中找到了解决方案。

    【讨论】:

      【解决方案2】:

      这是 phonegap 错误。 这是临时解决方案

      Install cordova-lib under
      ../node_modules/phonegap/node_modules/cordova
      

      转到 ../node_modules/phonegap/node_modules/cordova

      执行npm install cordova-lib

      【讨论】:

        【解决方案3】:

        我遇到了和你一样的问题。我刚刚卸载并重新安装了 NodeJS,这对我有用。

        要在 Windows 上卸载 NodeJS,请转到控制面板->程序和功能。在已安装软件列表中,您将找到 NodeJS。右键单击 NodeJS 并卸载它。

        要重新安装 NodeJS,请访问他们的网站。 click here 访问他们的网站并下载最新的 LTS 版本的 NodeJS。

        执行此操作后,检查您是否再次遇到相同的错误。如果你这样做,然后运行命令:

        npm install -g phonegap

        这绝对可以解决您的问题!干杯!

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 2018-12-30
          • 1970-01-01
          • 2016-12-20
          • 1970-01-01
          • 1970-01-01
          • 2021-01-20
          • 1970-01-01
          相关资源
          最近更新 更多