使用离子与纱线会导致cordova问题

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

我正在研究Ionic 3.9项目,所有依赖项都通过yarn进行管理。它让我发疯,因为当我尝试使用ionic cordova命令时,使用npm,我会遇到很多错误。

例如:

 $ ionic cordova platform add android
> cordova platform add android --save
Using cordova-fetch for [email protected]
Adding android project...
Creating Cordova project for the Android platform:
    Path: platforms/android
    Package: com.kohappy.push
    Name: kohappy
    Activity: MainActivity
    Android target: android-26
Subproject Path: CordovaLib
Subproject Path: app
Android project created with [email protected]
Android Studio project detected
Android Studio project detected
Installing "cordova-plugin-advanced-http" for android
Failed to install 'cordova-plugin-advanced-http': CordovaError: Failed to fetch plugin cordova-plugin-file@>=2.0.0 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 WARN @angular/[email protected] requires a peer of rxjs@^5.5.0 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/[email protected] requires a peer of rxjs@^5.5.0 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/[email protected] requires a peer of rxjs@^5.5.0 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/[email protected] requires a peer of rxjs@^5.5.0 but none is installed. You must install peer dependencies yourself.
npm WARN @ionic-native/[email protected] requires a peer of @ionic-native/core@^4.11.0 but none is installed. You must install peer dependencies yourself.
npm WARN @ionic-native/[email protected] requires a peer of rxjs@^5.5.11 but none is installed. You must install peer dependencies yourself.
npm WARN @ionic-native/[email protected] requires a peer of rxjs@^5.0.1 but none is installed. You must install peer dependencies yourself.
npm WARN @ionic-native/[email protected] requires a peer of @ionic-native/core@^4.11.0 but none is installed. You must install peer dependencies yourself.
npm WARN @ionic-native/[email protected] requires a peer of rxjs@^5.5.11 but none is installed. You must install peer dependencies yourself.
npm WARN @ionic-native/[email protected] requires a peer of @ionic-native/core@^4.11.0 but none is installed. You must install peer dependencies yourself.
npm WARN @ionic-native/[email protected] requires a peer of rxjs@^5.5.11 but none is installed. You must install peer dependencies yourself.
npm WARN @ionic-native/[email protected] requires a peer of @ionic-native/core@^4.11.0 but none is installed. You must install peer dependencies yourself.
npm WARN @ionic-native/[email protected] requires a peer of rxjs@^5.5.11 but none is installed. You must install peer dependencies yourself.
npm WARN @ionic-native/[email protected] requires a peer of @ionic-native/core@^4.11.0 but none is installed. You must install peer dependencies yourself.
npm WARN @ionic-native/[email protected] requires a peer of rxjs@^5.5.11 but none is installed. You must install peer dependencies yourself.
npm WARN @ionic-native/[email protected] requires a peer of @ionic-native/core@^4.11.0 but none is installed. You must install peer dependencies yourself.
npm WARN @ionic-native/[email protected] requires a peer of rxjs@^5.5.11 but none is installed. You must install peer dependencies yourself.
npm WARN @ionic-native/[email protected] requires a peer of rxjs@^5.0.1 but none is installed. You must install peer dependencies yourself.
npm WARN @ionic-native/[email protected] requires a peer of rxjs@^5.0.1 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of @angular/common@^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of @angular/core@^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of @angular/platform-browser@^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of @angular/platform-browser-dynamic@^6.0.0 but none is installed. You must install peer dependencies yourself.

npm ERR! code EBADPLATFORM
npm ERR! notsup Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm ERR! notsup Valid OS:    darwin
npm ERR! notsup Valid Arch:  any
npm ERR! notsup Actual OS:   linux
npm ERR! notsup Actual Arch: x64

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/louisro/.npm/_logs/2018-12-19T11_40_55_332Z-debug.log
    at /home/louisro/.nvm/versions/node/v8.9.4/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/fetch.js:161:37
    at _rejected (/home/louisro/.nvm/versions/node/v8.9.4/lib/node_modules/cordova/node_modules/q/q.js:864:24)
    at /home/louisro/.nvm/versions/node/v8.9.4/lib/node_modules/cordova/node_modules/q/q.js:890:30
    at Promise.when (/home/louisro/.nvm/versions/node/v8.9.4/lib/node_modules/cordova/node_modules/q/q.js:1142:31)
    at Promise.promise.promiseDispatch (/home/louisro/.nvm/versions/node/v8.9.4/lib/node_modules/cordova/node_modules/q/q.js:808:41)
    at /home/louisro/.nvm/versions/node/v8.9.4/lib/node_modules/cordova/node_modules/q/q.js:624:44
    at runSingle (/home/louisro/.nvm/versions/node/v8.9.4/lib/node_modules/cordova/node_modules/q/q.js:137:13)
    at flush (/home/louisro/.nvm/versions/node/v8.9.4/lib/node_modules/cordova/node_modules/q/q.js:125:13)
    at _combinedTickCallback (internal/process/next_tick.js:131:7)
    at process._tickCallback (internal/process/next_tick.js:180:9)
Failed to fetch plugin cordova-plugin-file@>=2.0.0 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 WARN @angular/[email protected] requires a peer of rxjs@^5.5.0 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/[email protected] requires a peer of rxjs@^5.5.0 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/[email protected] requires a peer of rxjs@^5.5.0 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/[email protected] requires a peer of rxjs@^5.5.0 but none is installed. You must install peer dependencies yourself.
npm WARN @ionic-native/[email protected] requires a peer of @ionic-native/core@^4.11.0 but none is installed. You must install peer dependencies yourself.
npm WARN @ionic-native/[email protected] requires a peer of rxjs@^5.5.11 but none is installed. You must install peer dependencies yourself.
npm WARN @ionic-native/[email protected] requires a peer of rxjs@^5.0.1 but none is installed. You must install peer dependencies yourself.
npm WARN @ionic-native/[email protected] requires a peer of @ionic-native/core@^4.11.0 but none is installed. You must install peer dependencies yourself.
npm WARN @ionic-native/[email protected] requires a peer of rxjs@^5.5.11 but none is installed. You must install peer dependencies yourself.
npm WARN @ionic-native/[email protected] requires a peer of @ionic-native/core@^4.11.0 but none is installed. You must install peer dependencies yourself.
npm WARN @ionic-native/[email protected] requires a peer of rxjs@^5.5.11 but none is installed. You must install peer dependencies yourself.
npm WARN @ionic-native/[email protected] requires a peer of @ionic-native/core@^4.11.0 but none is installed. You must install peer dependencies yourself.
npm WARN @ionic-native/[email protected] requires a peer of rxjs@^5.5.11 but none is installed. You must install peer dependencies yourself.
npm WARN @ionic-native/[email protected] requires a peer of @ionic-native/core@^4.11.0 but none is installed. You must install peer dependencies yourself.
npm WARN @ionic-native/[email protected] requires a peer of rxjs@^5.5.11 but none is installed. You must install peer dependencies yourself.
npm WARN @ionic-native/[email protected] requires a peer of @ionic-native/core@^4.11.0 but none is installed. You must install peer dependencies yourself.
npm WARN @ionic-native/[email protected] requires a peer of rxjs@^5.5.11 but none is installed. You must install peer dependencies yourself.
npm WARN @ionic-native/[email protected] requires a peer of rxjs@^5.0.1 but none is installed. You must install peer dependencies yourself.
npm WARN @ionic-native/[email protected] requires a peer of rxjs@^5.0.1 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of @angular/common@^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of @angular/core@^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of @angular/platform-browser@^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of @angular/platform-browser-dynamic@^6.0.0 but none is installed. You must install peer dependencies yourself.

npm ERR! code EBADPLATFORM
npm ERR! notsup Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm ERR! notsup Valid OS:    darwin
npm ERR! notsup Valid Arch:  any
npm ERR! notsup Actual OS:   linux
npm ERR! notsup Actual Arch: x64

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/louisro/.npm/_logs/2018-12-19T11_40_55_332Z-debug.log
[ERROR] An error occurred while running subprocess cordova.

        cordova platform add android --save exited with exit code 1.

        Re-running this command with the --verbose flag may provide more information.
cordova ionic-framework yarnpkg
1个回答
0
投票

编辑:抱歉纱线是社区之间的旧争论,即使在离子外也不支持cordova命令。

请参考:https://github.com/apache/cordova-cli/issues/303


您是否尝试将Ionic配置设置为使用纱线?

ionic config set -g yarn true

© www.soinside.com 2019 - 2024. All rights reserved.