我正在建立一个带有所有必要依赖项的Ionic项目。但是,当我运行命令“ionic serve”时,我会在终端中连续显示一行“[INFO] Waiting for connectivity with npm...”。这使我无法成功地运行这个项目。
下面是我的终端输出的相关部分:
npm.cmd run ionic:serve:before
[email protected] ionic:serve:before
gulp
Using gulpfile E:\NishantDataIonic\Moodle IOS\Moodle\gulpfile.js
Starting 'default'...
Starting 'lang'...
Starting 'env'...
Finished 'env' after 214 ms
Finished 'lang' after 1.04 s
Finished 'default' after 1.04 s
> npm.cmd run ionic:serve -- --host=localhost --port=8100
[npm] > [email protected] ionic:serve
[npm] > gulp watch & NODE_OPTIONS=--max-old-space-size=4096 ng serve --host=localhost --port=8100
[npm] [12:42:57] Using gulpfile E:\NishantDataIonic\Moodle IOS\Moodle\gulpfile.js
[npm] [12:42:57] Starting 'watch'...
[INFO] Waiting for connectivity with npm...
以下是我的Ionic环境信息:
Ionic:
Ionic CLI : 5.4.16 (C:\Users\user\AppData\Roaming\npm\node_modules\ionic)
Ionic Framework : @ionic/angular 5.0.5
@angular-devkit/build-angular : 15.2.8
@angular-devkit/schematics : 15.2.8
@angular/cli : 15.2.8
@ionic/angular-toolkit : 6.0.0
Cordova:
Cordova CLI : 10.0.0 ([email protected])
Cordova Platforms : not available
Cordova Plugins : not available
Utility:
cordova-res : 0.15.4
native-run : 1.7.2
System:
Android SDK Tools : 26.1.1 (C:\Users\user\AppData\Local\Android\Sdk)
NodeJS : v16.14.2 (C:\Program Files\nodejs\node.exe)
npm : 9.5.0
OS : Windows 10
我已经尝试将我的Node版本从14更改为16,并相应地调整了依赖项。我还在VS Code中安装了Angular和Ionic扩展。我正在寻求帮助解决这个问题,以便我可以成功地运行我的Ionic项目。任何指导或解决方案将不胜感激。
这是我的packege.json文件
{
"name": "wyres",
"version": "0.0.1",
"description": "The official app for WY RES.",
"author": {
"name": "Moodle Pty Ltd.",
"email": "[email protected]"
},
"repository": {
"type": "git",
"url": "https://github.com/moodlehq/moodlemobile2.git"
},
"license": "Apache-2.0",
"licenses": [
{
"type": "Apache-2.0",
"url": "http://www.apache.org/licenses/LICENSE-2.0"
}
],
"scripts": {
"ng": "ng",
"start": "ionic serve",
"build": "ionic build",
"build:prod": "NODE_ENV=production ionic build --prod",
"build:test": "NODE_ENV=testing ionic build",
"dev:android": "ionic cordova run android --livereload",
"dev:ios": "ionic cordova run ios --livereload",
"prod:android": "NODE_ENV=production ionic cordova run android --aot",
"prod:ios": "NODE_ENV=production ionic cordova run ios --aot",
"test": "NODE_ENV=testing gulp && jest --verbose",
"test:ci": "NODE_ENV=testing gulp && jest -ci --runInBand --verbose",
"test:watch": "NODE_ENV=testing gulp watch & jest --watch",
"test:coverage": "NODE_ENV=testing gulp && jest --coverage",
"lint": "NODE_OPTIONS=--max-old-space-size=4096 ng lint",
"ionic:serve:before": "gulp",
"ionic:serve": "gulp watch & NODE_OPTIONS=--max-old-space-size=4096 ng serve",
"ionic:build:before": "gulp"
},
"dependencies": {
"@angular/animations": "15.2.8",
"@angular/common": "15.2.8",
"@angular/core": "15.2.8",
"@angular/forms": "15.2.8",
"@angular/platform-browser": "15.2.8",
"@angular/platform-browser-dynamic": "15.2.8",
"@angular/router": "15.2.8",
"@capacitor/android": "5.2.3",
"@capacitor/app": "5.0.6",
"@capacitor/core": "5.2.3",
"@capacitor/haptics": "5.0.6",
"@capacitor/keyboard": "5.0.6",
"@capacitor/status-bar": "5.0.6",
"@ionic-native/badge": "5.0.0",
"@ionic-native/camera": "5.0.0",
"@ionic-native/chooser": "5.0.0",
"@ionic-native/clipboard": "5.0.0",
"@ionic-native/core": "5.0.0",
"@ionic-native/device": "5.0.0",
"@ionic-native/diagnostic": "5.0.0",
"@ionic-native/file": "5.0.0",
"@ionic-native/file-opener": "5.0.0",
"@ionic-native/file-transfer": "5.0.0",
"@ionic-native/geolocation": "5.0.0",
"@ionic-native/http": "5.0.0",
"@ionic-native/in-app-browser": "5.0.0",
"@ionic-native/ionic-webview": "5.0.0",
"@ionic-native/keyboard": "5.0.0",
"@ionic-native/local-notifications": "5.0.0",
"@ionic-native/media": "5.0.0",
"@ionic-native/media-capture": "5.0.0",
"@ionic-native/network": "5.0.0",
"@ionic-native/push": "5.0.0",
"@ionic-native/qr-scanner": "5.0.0",
"@ionic-native/splash-screen": "5.0.0",
"@ionic-native/sqlite": "5.0.0",
"@ionic-native/status-bar": "5.0.0",
"@ionic-native/web-intent": "5.0.0",
"@ionic-native/zip": "5.0.0",
"@ionic/angular": "^6.7.5",
"@ionic/utils-fs": "3.0.0",
"@ngx-translate/core": "13.0.0",
"@ngx-translate/http-loader": "6.0.0",
"@types/chart.js": "2.9.31",
"@types/cordova": "0.0.34",
"@types/cordova-plugin-file-transfer": "1.6.2",
"@types/dom-mediacapture-record": "1.0.7",
"chart.js": "2.9.4",
"com-darryncampbell-cordova-plugin-intent": "1.3.0",
"cordova": "10.0.0",
"cordova-android-support-gradle-release": "3.0.1",
"cordova-clipboard": "1.3.0",
"cordova-ios": "6.2.0",
"cordova-plugin-add-swift-support": "2.0.2",
"cordova-plugin-advanced-http": "3.1.0",
"cordova-plugin-badge": "0.8.8",
"cordova-plugin-camera": "5.0.1",
"cordova-plugin-chooser": "1.3.2",
"cordova-plugin-customurlscheme": "5.0.2",
"cordova-plugin-device": "2.0.3",
"cordova-plugin-file": "6.0.2",
"cordova-plugin-file-opener2": "3.0.5",
"cordova-plugin-geolocation": "4.1.0",
"cordova-plugin-globalization": "1.11.0",
"cordova-plugin-ionic-keyboard": "2.2.0",
"cordova-plugin-ionic-webview": "5.0.0",
"cordova-plugin-media": "5.0.3",
"cordova-plugin-media-capture": "3.0.3",
"cordova-plugin-network-information": "2.0.2",
"cordova-plugin-screen-orientation": "3.0.2",
"cordova-plugin-splashscreen": "6.0.0",
"cordova-plugin-statusbar": "2.4.3",
"cordova-plugin-whitelist": "1.3.4",
"cordova-plugin-zip": "3.1.0",
"cordova-sqlite-storage": "6.0.0",
"cordova.plugins.diagnostic": "5.0.2",
"core-js": "3.9.1",
"es6-promise-plugin": "4.2.2",
"jszip": "3.5.0",
"lru-cache": "7.13.1",
"mathjax": "2.7.7",
"moment": "2.29.0",
"nl.kingsquare.cordova.background-audio": "1.0.1",
"phonegap-plugin-multidex": "1.0.0",
"rxjs": "7.4.0",
"ts-md5": "1.2.7",
"tslib": "2.0.1",
"zone.js": "0.13.1"
},
"devDependencies": {
"@angular-devkit/architect": "0.1101.2",
"@angular-devkit/build-angular": "15.2.8",
"@angular-devkit/core": "15.2.8",
"@angular-devkit/schematics": "15.2.8",
"@angular-eslint/builder": "16.1.0",
"@angular-eslint/eslint-plugin": "16.1.0",
"@angular-eslint/eslint-plugin-template": "16.1.0",
"@angular-eslint/schematics": "15.2.1",
"@angular-eslint/template-parser": "16.1.0",
"@angular/cli": "15.2.8",
"@angular/compiler": "15.2.8",
"@angular/compiler-cli": "15.2.8",
"@angular/language-service": "10.0.14",
"@capacitor/cli": "5.2.3",
"@ionic/angular-toolkit": "6.0.0",
"@ionic/cli": "6.4.0",
"@types/faker": "5.1.3",
"@types/node": "12.12.64",
"@types/resize-observer-browser": "0.1.5",
"@types/webpack-env": "1.16.0",
"@typescript-eslint/eslint-plugin": "4.22.0",
"@typescript-eslint/parser": "4.22.0",
"check-es-compat": "1.1.1",
"cordova-android": "^9.1.0",
"cordova-plugin-file-transfer": "git+https://github.com/moodlemobile/cordova-plugin-file-transfer.git",
"cordova-plugin-inappbrowser": "git+https://github.com/moodlemobile/cordova-plugin-inappbrowser.git#moodle-ionic5",
"cordova-plugin-local-notification": "git+https://github.com/moodlemobile/cordova-plugin-local-notification.git#moodle",
"cordova-plugin-prevent-override": "git+https://github.com/moodlemobile/cordova-plugin-prevent-override.git",
"cordova-plugin-qrscanner": "git+https://github.com/moodlemobile/cordova-plugin-qrscanner.git#dist",
"cordova-plugin-wkuserscript": "git+https://github.com/moodlemobile/cordova-plugin-wkuserscript.git",
"cordova-plugin-wkwebview-cookies": "git+https://github.com/moodlemobile/cordova-plugin-wkwebview-cookies.git",
"cordova-support-google-services": "^1.2.1",
"eslint": "7.25.0",
"eslint-config-prettier": "8.3.0",
"eslint-plugin-header": "3.1.1",
"eslint-plugin-import": "2.22.1",
"eslint-plugin-jest": "24.3.6",
"eslint-plugin-jsdoc": "32.3.3",
"eslint-plugin-prefer-arrow": "1.2.3",
"eslint-plugin-promise": "5.1.0",
"faker": "5.1.0",
"fs-extra": "9.1.0",
"gulp": "4.0.2",
"gulp-clip-empty-files": "0.1.2",
"gulp-concat": "2.6.1",
"gulp-flatten": "0.4.0",
"gulp-htmlmin": "5.0.1",
"gulp-rename": "2.0.0",
"gulp-slash": "1.1.3",
"jest": "29.6.2",
"jest-preset-angular": "13.1.1",
"jsonc-parser": "2.3.1",
"native-run": "^1.4.0",
"phonegap-plugin-push": "git+https://github.com/moodlemobile/phonegap-plugin-push.git#moodle-v3",
"ts-jest": "29.1.1",
"ts-node": "8.3.0",
"typescript": "4.9.5"
},
"engines": {
"npm": "9.5.0",
"node": "v16.14.2"
},
"cordova": {
"platforms": [
"ios"
],
"plugins": {
"cordova-plugin-advanced-http": {},
"cordova-clipboard": {},
"cordova-plugin-badge": {},
"cordova-plugin-camera": {
"ANDROID_SUPPORT_V4_VERSION": "27.+"
},
"cordova-plugin-chooser": {},
"cordova-plugin-customurlscheme": {
"URL_SCHEME": "moodlemobile",
"ANDROID_SCHEME": " ",
"ANDROID_HOST": " ",
"ANDROID_PATHPREFIX": "/"
},
"cordova-plugin-device": {},
"cordova-plugin-file-opener2": {
"ANDROID_SUPPORT_V4_VERSION": "27.+"
},
"cordova-plugin-geolocation": {
"GPS_REQUIRED": "false"
},
"cordova-plugin-inappbrowser": {},
"cordova-plugin-ionic-keyboard": {},
"cordova-plugin-ionic-webview": {},
"cordova-plugin-local-notification": {
"ANDROID_SUPPORT_V4_VERSION": "26.+"
},
"cordova-plugin-media-capture": {},
"cordova-plugin-media": {
"KEEP_AVAUDIOSESSION_ALWAYS_ACTIVE": "NO"
},
"cordova-plugin-network-information": {},
"cordova-plugin-qrscanner": {},
"cordova-plugin-screen-orientation": {},
"cordova-plugin-splashscreen": {},
"cordova-plugin-statusbar": {},
"cordova-plugin-whitelist": {},
"cordova-plugin-wkuserscript": {},
"cordova-plugin-wkwebview-cookies": {},
"cordova-plugin-zip": {},
"cordova-sqlite-storage": {},
"phonegap-plugin-push": {
"ANDROID_SUPPORT_V13_VERSION": "27.+",
"FCM_VERSION": "17.0.+"
},
"com-darryncampbell-cordova-plugin-intent": {},
"nl.kingsquare.cordova.background-audio": {},
"cordova-android-support-gradle-release": {
"ANDROID_SUPPORT_VERSION": "27.+"
},
"cordova.plugins.diagnostic": {
"ANDROID_SUPPORT_VERSION": "28.+"
},
"cordova-plugin-globalization": {},
"cordova-plugin-file-transfer": {},
"cordova-plugin-prevent-override": {}
}
},
"optionalDependencies": {
"keytar": "7.2.0"
}
}
1条答案
按热度按时间kq0g1dla1#
第一步,你能尝试更新你的ionic版本吗?Angular 15+需要离子6.3+
| 离子V|最小Ng版本|最大Ng版本|
| --|--|--|
| V7| v14| v16+|
| V6| V12| V15|
| V5| v8.2| V12|
从Ionic v6.1.9开始支持Angular 14.x。从Ionic v6.3.6开始支持Angular 15.x。
https://ionicframework.com/docs/reference/support#ionic-angular
您可以在ionic文档中找到更新指南(如果需要)