PhoneRTC:git-submodule 坏了

Posted

技术标签:

【中文标题】PhoneRTC:git-submodule 坏了【英文标题】:PhoneRTC: git-submodule is broken 【发布时间】:2017-12-14 02:48:58 【问题描述】:

我正在使用 Wiki 指南来测试插件。

当我执行命令时:

cordova plugin add https://github.com/alongubkin/phonertc.git

PC 卡住几分钟然后给出错误(来自日志):

0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli   'C:\\Users\\Sandro\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'install',
1 verbose cli   'https://github.com/alongubkin/phonertc.git',
1 verbose cli   '--save' ]
2 info using npm@5.1.0
3 info using node@v8.1.3
4 verbose npm-session e0fe9efdcc26a6c4
5 silly install loadCurrentTree
6 silly install readLocalPackageData
7 silly fetchPackageMetaData error for git+https://github.com/alongubkin/phonertc.git Command failed: c:\Program Files\Git\mingw64\libexec\git-core\git.EXE submodule update -q --init --recursive
7 silly fetchPackageMetaData fatal: 'submodule' appears to be a git command, but we were not
7 silly fetchPackageMetaData able to execute it. Maybe git-submodule is broken?
8 verbose stack Error: Command failed: c:\Program Files\Git\mingw64\libexec\git-core\git.EXE submodule update -q --init --recursive
8 verbose stack fatal: 'submodule' appears to be a git command, but we were not
8 verbose stack able to execute it. Maybe git-submodule is broken?
8 verbose stack
8 verbose stack     at ChildProcess.exithandler (child_process.js:270:12)
8 verbose stack     at emitTwo (events.js:125:13)
8 verbose stack     at ChildProcess.emit (events.js:213:7)
8 verbose stack     at maybeClose (internal/child_process.js:897:16)
8 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:208:5)
9 verbose cwd C:\Users\Sandro\androidStudioProjects\[PhoneGap]\phonertc_demo\node_modules
10 verbose Windows_NT 10.0.14393
11 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Sandro\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install" "https://github.com/alongubkin/phonertc.git" "--save"
12 verbose node v8.1.3
13 verbose npm  v5.1.0
14 error code 128
15 error Command failed: c:\Program Files\Git\mingw64\libexec\git-core\git.EXE submodule update -q --init --recursive
15 error fatal: 'submodule' appears to be a git command, but we were not
15 error able to execute it. Maybe git-submodule is broken?
16 verbose exit [ 1, true ]

Cordova、Node、Npm 运行良好。 Git 也是,我正在使用 Mingw64。

从 Mingw 本身尝试,引发另一个错误:

Error: Failed to fetch plugin https://github.com/alongubkin/phonertc.git via registry.
Probably this is either a connection problem, or plugin spec is incorrect.
Check your connection and plugin name/version/URL.
Error: cmd: Command failed with exit code 1 Error output:
npm ERR! cb() never called!

npm ERR! This is an error with npm itself. Please report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Sandro\AppData\Roaming\npm-cache\_logs\2017-07-10T11_26_43_415Z-debug.log

我已经尝试从管理员控制台启动所有内容,同样的错误。

无法确定问题。欢迎任何提示。

【问题讨论】:

你尝试过自己运行git.EXE submodule update -q --init --recursive 吗? 你好@n00dl3,是的,我试过了,它会导致同样的错误(致命:'submodule' 似乎是一个 git 命令,但是......)。因此,我从 mingw 控制台(也以管理员身份)运行初始命令,这导致了我报告的第二个错误。无论如何,两者都很奇怪,因为我正在处理具有适当权限的文件夹。 【参考方案1】:

似乎无法使用新的获取逻辑来获取这个(和其他)插件。 为了使添加插件工作,你必须使用旧的,添加

--nofetch

标志。添加插件的命令是:

cordova 插件添加https://github.com/alongubkin/phonertc.git --nofetch

【讨论】:

以上是关于PhoneRTC:git-submodule 坏了的主要内容,如果未能解决你的问题,请参考以下文章

PhoneRTC 64 位支持?

phonertc 未定义 - 浏览器上的 Cordova phonertc

PhoneRTC 演示应用程序

运行 PhoneRTC 演示

离子中的PhoneRTC

将 PhoneRTC 与 Worklight 一起使用