Ionic cordova无法下载插件cordova-custom-config

pw136qt2  于 2022-12-08  发布在  Ionic
关注(0)|答案(2)|浏览(395)

我一直在竭尽全力地为ios和android构建我的ionic应用程序。我多次添加和删除平台。升级和降级我的ionic应用程序和java JDK,但没有任何效果。现在常见的错误似乎是与插件'cordova-custom-config'。
尝试通过命令$ sudo ionic cordova platform add ios@latest --fetch --save --verbose添加ios平台时,错误为:

Discovered plugin "cordova-custom-config" in config.xml. Adding it to the project

Failed to restore plugin "cordova-custom-config" from config.xml. You might need to try adding it again. Error: Failed to fetch plugin cordova-custom-config@^5.0.1 via registry.
Probably this is either a connection problem, or plugin spec is incorrect.
Check your connection and plugin name/version/URL.
Error: npm: Command failed with exit code 1 Error output:
npm ERR! code 1
npm ERR! Command failed: /usr/local/bin/git clone -q git://github.com/xiangpingmeng/plist.js.git /Users/adamgoldberg/.npm/_cacache/tmp/git-clone-87b2ddaf
npm ERR! /Users/adamgoldberg/.npm/_cacache/tmp/git-clone-87b2ddaf/.git: Permission denied
npm ERR!

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/adamgoldberg/.npm/_logs/2018-02-07T04_04_30_105Z-debug.log

--save flag or autosave detected

Saving ios@latest into config.xml file ...
[ERROR] Exception:

当尝试通过命令添加android平台时,$ sudo ionic cordova platform add android@6.3.0 --fetch --save --verbose the errorios相同。请注意,我添加的是android@6.3.0,而不是android@latest,因为latest(7.0.0)有错误。
当我尝试通过命令$ sudo cordova plugin add cordova-custom-config --fetch --verbose添加cordova-custom-config插件时,错误为:

(node:16626) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): CordovaError: Failed to fetch plugin cordova-custom-config@^5.0.1 via registry.
Probably this is either a connection problem, or plugin spec is incorrect.
Check your connection and plugin name/version/URL.
Error: npm: Command failed with exit code 1 Error output:
npm ERR! code 1
npm ERR! Command failed: /usr/local/bin/git clone -q git://github.com/xiangpingmeng/plist.js.git /Users/adamgoldberg/.npm/_cacache/tmp/git-clone-0ad7ea7b
npm ERR! /Users/adamgoldberg/.npm/_cacache/tmp/git-clone-0ad7ea7b/.git: Permission denied
npm ERR!

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/adamgoldberg/.npm/_logs/2018-02-07T04_12_20_482Z-debug.log
(node:16626) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

这是我的ionic info

cli packages: (/usr/local/lib/node_modules)

    @ionic/cli-utils  : 1.19.1
    ionic (Ionic CLI) : 3.19.1

global packages:

    cordova (Cordova CLI) : 8.0.0

local packages:

    @ionic/app-scripts : 3.1.8
    Cordova Platforms  : none
    Ionic Framework    : ionic-angular 3.9.2

System:

    Android SDK Tools : 26.1.1
    ios-sim           : 6.0.0
    Node              : v8.8.1
    npm               : 5.6.0
    OS                : macOS High Sierra
    Xcode             : Xcode 9.2 Build version 9C40b

Environment Variables:

    ANDROID_HOME : /Users/adamgoldberg/Library/Android/sdk

Misc:

    backend : pro
kupeojn6

kupeojn61#

尝试安装到以前包含旧版本插件的项目中时似乎出现了问题。请尝试清除以前的残余:

rm -Rf node_modules/cordova-custom-config and rm -Rf plugins/cordova-custom-config

如果仍有问题,请使用new cordova-fetch option进行安装

cordova plugin add cordova-custom-config --fetch
ezykj2lf

ezykj2lf2#

1.转到插件目录:
cd plugins/cordova-custom-config/
1.手动安装
npm install

相关问题