Ionic framework 在爱奥尼亚Cli版本之间切换?
我正在从事多个项目,其中一些使用Ionic 1,另一些使用Ionic 4。然而,在它们之间切换已成为一个问题。在将Ionic CLI更新为最新版本并使用4之后,我现在正在尝试使用较旧的Ionic 1 问题是每次运行Ionic framework 在爱奥尼亚Cli版本之间切换?,ionic-framework,ionic4,ionic-cli,Ionic Framework,Ionic4,Ionic Cli,我正在从事多个项目,其中一些使用Ionic 1,另一些使用Ionic 4。然而,在它们之间切换已成为一个问题。在将Ionic CLI更新为最新版本并使用4之后,我现在正在尝试使用较旧的Ionic 1 问题是每次运行ionic service时,我都会得到以下结果: Error: spawn ENOTDIR at _errnoException (util.js:1024:11) at ChildProcess.spawn (internal/child_process.js:323:11) a
ionic service
时,我都会得到以下结果:
Error: spawn ENOTDIR
at _errnoException (util.js:1024:11)
at ChildProcess.spawn (internal/child_process.js:323:11)
at Object.exports.spawn (child_process.js:502:9)
at spawn (/usr/local/lib/node_modules/ionic/node_modules/cross-spawn/index.js:17:18)
at spawn (/usr/local/lib/node_modules/ionic/node_modules/@ionic/cli-framework/utils/shell.js:124:12)
at ShellCommand.spawn (/usr/local/lib/node_modules/ionic/node_modules/@ionic/cli-framework/utils/shell.js:113:16)
at Shell.spawn (/usr/local/lib/node_modules/ionic/node_modules/@ionic/cli-utils/lib/shell.js:136:23)
at Ionic1ServeCLI.<anonymous> (/usr/local/lib/node_modules/ionic/node_modules/@ionic/cli-utils/lib/serve.js:398:36)
at Generator.next (<anonymous>)
at fulfilled (/usr/local/lib/node_modules/ionic/node_modules/tslib/tslib.js:104:62)
据我所知,文档显示最新的CLI是向后兼容的
编辑:
爱奥尼亚信息:
Ionic:
ionic (Ionic CLI) : 4.1.2 (/usr/local/lib/node_modules/ionic)
Ionic Framework : ionic1 1.3.3
@ionic/v1-toolkit : not installed
Cordova:
cordova (Cordova CLI) : 8.0.0
Cordova Platforms : android 6.3.0
Cordova Plugins : no whitelisted plugins (13 plugins total)
System:
Android SDK Tools : 26.1.1 (/Users/jrquick/Library/Android/sdk)
NodeJS : v8.9.2 (/usr/local/bin/node)
npm : 6.4.1
OS : macOS High Sierra
显然,为了支持最新的Ionic CLI,需要在ionic1项目中实施一些更改。为了解决这个问题,我更新了最新的爱奥尼亚(
sudonpm安装-g)ionic@latest
),创建了一个临时项目(ionic start myproject--type ionic1
),然后比较文件以查看发生了什么变化
我的步骤(示例见下文)
rm-f package-lock.json&&rm-rf node_modules/&&rm-rf www/lib/&&npm install&&bower install
{
"name": "r01",
"private": true,
"devDependencies": {
"ionic": "driftyco/ionic-bower#1.3.4"
},
"authors": [
"jrquick <>"
],
"description": "",
"main": "",
"license": "",
"homepage": "",
"dependencies": {
"ngCordova": "^0.1.27-alpha",
"ionic-toast": "^0.4.1",
"angular-perfect-scrollbar": "^0.2.1",
"ionic-calendar": "^0.3.8",
"ionic-color-picker": "^1.0.3"
}
}
ionic.starter.json
{
"name": "r01",
"baseref": "master"
}
package.json
{
"name": "r01",
"version": "2.6.3",
"description": "",
"dependencies": {
"cordova": "^8.0.0",
"cordova-android": "^7.1.1",
"cordova-externalstoragepath-plugin": "^1.0.4",
"cordova-ios": "~4.5.5",
"cordova-plugin-compat": "^1.2.0",
"cordova-plugin-console": "^1.1.0",
"cordova-plugin-device": "^2.0.2",
"cordova-plugin-exclude-files": "^0.4.1",
"cordova-plugin-file": "^6.0.1",
"cordova-plugin-inappbrowser": "^3.0.0",
"cordova-plugin-network-information": "^2.0.1",
"cordova-plugin-screen-orientation": "^3.0.1",
"cordova-plugin-splashscreen": "^5.0.2",
"cordova-plugin-statusbar": "^2.4.2",
"cordova-plugin-whitelist": "^1.3.3",
"es6-promise-plugin": "^4.2.2",
"ionic-plugin-keyboard": "^2.2.1"
},
"devDependencies": {
"@ionic/v1-toolkit": "^1.0.0",
"gulp": "^3.5.6",
"gulp-clean-css": "^3.7.0",
"gulp-rename": "^1.2.0",
"gulp-sass": "^3.1.0",
"ionic-minify": "^2.0.10"
},
"cordovaPlugins": [
"cordova-plugin-device",
"cordova-plugin-console",
"cordova-plugin-whitelist",
"cordova-plugin-splashscreen",
"cordova-plugin-statusbar",
"ionic-plugin-keyboard"
],
"cordovaPlatforms": [],
"main": "gulpfile.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "[PRIVATE REPO]"
},
"author": "jrquick <>",
"homepage": "[PRIVATE HOMEPAGE]",
"cordova": {
"plugins": {
"cordova-plugin-console": {},
"cordova-plugin-device": {},
"cordova-plugin-network-information": {},
"cordova-plugin-screen-orientation": {},
"cordova-plugin-splashscreen": {},
"cordova-plugin-statusbar": {},
"cordova-plugin-whitelist": {},
"ionic-plugin-keyboard": {},
"cordova-plugin-file": {},
"cordova-externalstoragepath-plugin": {},
"cordova-plugin-inappbrowser": {},
"cordova-plugin-exclude-files": {}
},
"platforms": [
"android"
]
}
}
{
“名称”:“r01”,
“版本”:“2.6.3”,
“说明”:“,
“依赖项”:{
“科尔多瓦”:“^8.0.0”,
“cordova android”:“^7.1.1”,
“cordova externalstoragepath插件”:“^1.0.4”,
“cordova ios”:“~4.5.5”,
“cordova插件兼容”:“^1.2.0”,
“cordova插件控制台”:“^1.1.0”,
“cordova插件设备”:“^2.0.2”,
“cordova插件排除文件”:“^0.4.1”,
“cordova插件文件”:“^6.0.1”,
“应用浏览器中的cordova插件”:“^3.0.0”,
“cordova插件网络信息”:“^2.0.1”,
“cordova插件屏幕方向”:“^3.0.1”,
“cordova插件splashscreen”:“^5.0.2”,
“cordova插件状态栏”:“^2.4.2”,
“cordova插件白名单”:“^1.3.3”,
“es6承诺插件”:“^4.2.2”,
“爱奥尼亚插件键盘”:“^2.2.1”
},
“依赖性”:{
“@ionic/v1工具包”:“^1.0.0”,
“吞咽”:“^3.5.6”,
“大口喝干净css”:“^3.7.0”,
“吞咽重命名”:“^1.2.0”,
“大口大口大口喝”:“^3.1.0”,
“离子缩小”:“^2.0.10”
},
“cordovaPlugins”:[
“cordova插件设备”,
“cordova插件控制台”,
“cordova插件白名单”,
“cordova插件splashscreen”,
“cordova插件状态栏”,
“离子插件键盘”
],
“Cordova平台”:[],
“main”:“gulpfile.js”,
“脚本”:{
“测试”:“echo\”错误:未指定测试\“&退出1”
},
“存储库”:{
“类型”:“git”,
“url”:“[私人回购]”
},
“作者”:“jrquick”,
“主页”:“[私人主页]”,
“科尔多瓦”:{
“插件”:{
“cordova插件控制台”:{},
“cordova插件设备”:{},
“cordova插件网络信息”:{},
“cordova插件屏幕方向”:{},
“cordova插件splashscreen”:{},
“cordova插件状态栏”:{},
“cordova插件白名单”:{},
“爱奥尼亚插件键盘”:{},
“cordova插件文件”:{},
“cordova externalstoragepath插件”:{},
“应用浏览器中的cordova插件”:{},
“cordova插件排除文件”:{}
},
“平台”:[
“安卓”
]
}
}
{
"name": "r01",
"baseref": "master"
}
{
"name": "r01",
"version": "2.6.3",
"description": "",
"dependencies": {
"cordova": "^8.0.0",
"cordova-android": "^7.1.1",
"cordova-externalstoragepath-plugin": "^1.0.4",
"cordova-ios": "~4.5.5",
"cordova-plugin-compat": "^1.2.0",
"cordova-plugin-console": "^1.1.0",
"cordova-plugin-device": "^2.0.2",
"cordova-plugin-exclude-files": "^0.4.1",
"cordova-plugin-file": "^6.0.1",
"cordova-plugin-inappbrowser": "^3.0.0",
"cordova-plugin-network-information": "^2.0.1",
"cordova-plugin-screen-orientation": "^3.0.1",
"cordova-plugin-splashscreen": "^5.0.2",
"cordova-plugin-statusbar": "^2.4.2",
"cordova-plugin-whitelist": "^1.3.3",
"es6-promise-plugin": "^4.2.2",
"ionic-plugin-keyboard": "^2.2.1"
},
"devDependencies": {
"@ionic/v1-toolkit": "^1.0.0",
"gulp": "^3.5.6",
"gulp-clean-css": "^3.7.0",
"gulp-rename": "^1.2.0",
"gulp-sass": "^3.1.0",
"ionic-minify": "^2.0.10"
},
"cordovaPlugins": [
"cordova-plugin-device",
"cordova-plugin-console",
"cordova-plugin-whitelist",
"cordova-plugin-splashscreen",
"cordova-plugin-statusbar",
"ionic-plugin-keyboard"
],
"cordovaPlatforms": [],
"main": "gulpfile.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "[PRIVATE REPO]"
},
"author": "jrquick <>",
"homepage": "[PRIVATE HOMEPAGE]",
"cordova": {
"plugins": {
"cordova-plugin-console": {},
"cordova-plugin-device": {},
"cordova-plugin-network-information": {},
"cordova-plugin-screen-orientation": {},
"cordova-plugin-splashscreen": {},
"cordova-plugin-statusbar": {},
"cordova-plugin-whitelist": {},
"ionic-plugin-keyboard": {},
"cordova-plugin-file": {},
"cordova-externalstoragepath-plugin": {},
"cordova-plugin-inappbrowser": {},
"cordova-plugin-exclude-files": {}
},
"platforms": [
"android"
]
}
}