无法从 GitHub 安装 Cordova 插件

问题描述 投票:0回答:1

我是 Cordova 新手,我尝试向我的项目添加一些包。我需要从 GitHub 安装一个特定的包,所以我尝试使用以下方法:

cordova plugin add https://github.com/acipher/pos

但它给了我以下内容:

Failed to fetch plugin https://github.com/acipher/pos via registry.
Probably this is either a connection problem, or plugin spec is incorrect.
Check your connection and plugin name/version/URL.
CordovaError: Error: ENOENT: no such file or directory, open 'C:\Users\<USERNAME>\AppData\Local\npm-cache\_cacache\tmp\git-clonepy4F6q\package.json'

然后我尝试从 npm 和 GitHub 添加其他一些内容,它们都有效,这意味着包本身肯定有问题。由于我是科尔多瓦新手,我真的不能说为什么它不起作用。

我使用的版本:

Cordova: 12.0.0 ([email protected])
Node.js: v17.9.1
Npm: 8.11.0
node.js cordova github npm cordova-plugins
1个回答
0
投票

只需在 config.xml 中声明它即可,例如

     <plugin name="cordova-plugin-someplugin" spec="git+https://github.com/something/cordova-plugin-someplugin" />

只需确保替换插件名称和插件存储库网址

最新问题
© www.soinside.com 2019 - 2025. All rights reserved.