Cordova平台添加错误 - 版本不能超过256个字符

时间:2017-08-28 22:58:10

标签: android cordova ionic-framework

我在我的新笔记本电脑上安装了IONIC和Cordova。已安装JAVA,Android等 当我尝试添加平台android时,我得到所有4个插件的错误。 错误信息是:      TypeError:版本超过256个字符

ionic cordova build android
[INFO] Enabling Cordova integration.
> ionic config set integrations.cordova {} --json --force
[OK] integrations.cordova set to {} in .\ionic.config.json!
> cordova platform add android --save
в Running command - failed!
[ERROR] Exception: Using cordova-fetch for cordova-android@~6.2.2

    Adding android project...
    Creating Cordova project for the Android platform:
            Path: platforms\android
            Package: io.ionic.starter
            Name: MyApp
            Activity: MainActivity
            Android target: android-25
    Subproject Path: CordovaLib
    Android project created with cordova-android@6.2.3
    Discovered plugin "cordova-plugin-console" in config.xml. Adding it to the project
    Installing "cordova-plugin-console" for android
    Failed to install 'cordova-plugin-console': TypeError: version is longer than 256 characters
         at new SemVer (C:\Users\hillesc\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\node_modules\semver\semver.js:283:11)
         at compare (C:\Users\hillesc\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\node_modules\semver\semver.js:566:10)
         at Function.gte (C:\Users\hillesc\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\node_modules\semver\semver.js:615:10)
         at C:\Users\hillesc\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\plugman\install.js:629:24
         at _fulfilled (C:\app3\todo\platforms\android\cordova\node_modules\q\q.js:854:54)
         at self.promiseDispatch.done (C:\app3\todo\platforms\android\cordova\node_modules\q\q.js:883:30)
         at Promise.promise.promiseDispatch (C:\app3\todo\platforms\android\cordova\node_modules\q\q.js:816:13)
         at C:\app3\todo\platforms\android\cordova\node_modules\q\q.js:624:44
         at runSingle (C:\app3\todo\platforms\android\cordova\node_modules\q\q.js:137:13)
         at flush (C:\app3\todo\platforms\android\cordova\node_modules\q\q.js:125:13)
    Failed to restore plugin "cordova-plugin-console" from config.xml. You might need to try adding it again. Error: TypeError: version is longer than 256 characters

    Running command: "C:\Program Files\nodejs\node.exe" C:\app3\todo\hooks\after_prepare\010_add_platform_class.js C:\app3\todo
    add to body class: platform-android
    --save flag or autosave detected
    Saving android@~6.2.3 into config.xml file ...

离子信息

cli packages: (C:\Users\hillesc\AppData\Roaming\npm\node_modules)

@ionic/cli-utils  : 1.9.2
ionic (Ionic CLI) : 3.9.2

全球套餐:

Cordova CLI : 7.0.1

本地包裹:

Cordova Platforms : android C:\app3\todo>set cihdrive=c: C:\app3\todo>set cihdir=c:\cih C:\app3\todo>set servdir=c:\cih\service C:\app3\todo>path C:\Users\hillesc\bin;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\local\bin;C:\Program Files\Git\usr\bin;C:\Program Files\Git\usr\bin;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;C:\Users\hillesc\bin;C:\ProgramData\Oracle\Java\javapath;C:\xTools;C:\windows\SYSTEM32;C:\windows;C:\windows\SYSTEM32\WBEM;C:\windows\SYSTEM32\WINDOWSPOWERSHELL\V1.0;C:\PROGRAM FILES (X86)\INTEL\SERVICES\IPT;C:\PROGRAM FILES (X86)\COMMON FILES\ULEAD SYSTEMS\MPEG;C:\Program Files\ThinkPad\Bluetooth Software;C:\Program Files\ThinkPad\Bluetooth Software\syswow64;C:\Program Files\Intel\WiFi\bin;C:\Program Files\Common Files\Intel\WirelessCommon;C:\Program Files (x86)\Microsoft SQL Server\90\Tools\binn;C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn;C:\Program Files\Microsoft SQL Server\100\Tools\Binn;C:\Program Files\Microsoft SQL Server\100\DTS\Binn;C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE;C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies;C:\Program Files (x86)\Microsoft SQL Server\100\DTS\Binn;C:\Program Files\TortoiseSVN\bin;C:\Program Files\Microsoft\Web Platform Installer;C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v1.0;C:\Program Files (x86)\Windows Kits\8.0\Windows Performance Toolkit;C:\Program Files\Microsoft SQL Server\110\Tools\Binn;C:\Program Files (x86)\Common Files\Intuit\QBPOSSDKRuntime;C:\Program Files (x86)\Hyland\Web ActiveX;C:\Program Files\Microsoft System Center 2012 R2\Service Manager;C:\Program Files\Git\cmd;C:\Program Files\Java\jdk1.8.0_111\bin;C:\Program Files\nodejs;C:\Program Files\Intel\WiFi\bin;C:\Program Files\Common Files\Intel\WirelessCommon;C:\Users\hillesc\AppData\Roaming\npm;C:\Program Files\Java\jdk1.8.0_111\bin;C:\Users\hillesc\AppData\Local\Android\sdk\tools;C:\Users\hillesc\AppData\Local\Android\sdk\platform-tools;C:\Program Files\Git\usr\bin\vendor_perl;C:\Program Files\Git\usr\bin\core_perl;c:\cih\util 6.2.3
Ionic Framework   : ionic1 1.3.3

系统:

Android SDK Tools : 26.0.2
Node              : v6.11.2
npm               : 3.10.10
OS                : Windows 7

1 个答案:

答案 0 :(得分:1)

感谢Gandhi的评论。是的我发现了这个问题,它可以帮助1个人中的一个:我在HKLM \ Software \ Microsoft \ Command Processor中有一个注册表项自动运行一个作业(a.bat,有点像旧的" autoexec .bat")其中包含准确的SET命令。

不知何故,每次打开命令提示符时都会运行,这会破坏我的平台。

一旦我把它拿出来,现在在#34;平台" “离子信息”的一部分"离子信息"命令。谢谢! (我的同事为我发布了这个问题,所以我不能给点意见。)