如何使用 PhoneGap 修复“找不到模块 'bplist-parser'”错误?

Tim*_*Tim 7 phone nodejs

我已经安装了所有东西 - node.js 然后用来npm获取 PhoneGap。

但是当我启动PhoneGap时出现此错误:

phonegap
Run Code Online (Sandbox Code Playgroud)
module.js:340
    throw err;
          ^
Error: Cannot find module 'bplist-parser'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (/usr/local/lib/node_modules/phonegap/node_modules/cordova/node_modules/cordova-lib/node_modules/cordova-common/src/ConfigChanges/ConfigFile.js:20:14)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
Run Code Online (Sandbox Code Playgroud)

Tim*_*Tim 13

只需使用以下命令更新依赖项npm

sudo npm update -g
Run Code Online (Sandbox Code Playgroud)

它将启动:

phonegap
Run Code Online (Sandbox Code Playgroud)
Usage: phonegap [options] [commands]

Description:

  PhoneGap command-line tool.

Commands:

  help [command]       output usage information
  create <path>        create a phonegap project
  build <platforms>    build the project for a specific platform
  install <platforms>  install the project on for a specific platform
  run <platforms>      build and install the project for a specific platform
  platform [command]   update a platform version
  plugin [command]     add, remove, and list plugins
  template [command]   list available app templates
  ...
Run Code Online (Sandbox Code Playgroud)

来源

我的代词是他/他