即使我的本地node_modules中安装了@ angular / core版本,在我的项目文件夹中运行ionic serve
后,我仍然会遇到此错误。是什么导致此问题,如何解决?似乎没有任何错误,因为直到我开始使用mapbox时才抛出错误,如下所示。这是我的 package.json :
{
"name": "outsourcd",
"version": "0.0.1",
"author": "Ionic Framework",
"homepage": "https://ionicframework.com/",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"@angular-builders/custom-webpack": "^10.0.0",
"@angular/cli": "^9.1.12",
"@angular/common": "^9.1.12",
"@angular/core": "^9.1.12",
"@angular/fire": "^6.0.2",
"@angular/forms": "~10.0.0",
"@angular/platform-browser": "~10.0.0",
"@angular/platform-browser-dynamic": "~10.0.0",
"@angular/router": "~10.0.0",
"@capacitor/core": "2.4.0",
"@ionic-native/core": "^5.0.0",
"@ionic-native/splash-screen": "^5.0.0",
"@ionic-native/status-bar": "^5.0.0",
"@ionic/angular": "^5.0.0",
"firebase": "^7.19.0",
"mapbox-gl": "^1.12.0",
"rxjs": "~6.6.2",
"tslib": "^2.0.0",
"zone.js": "~0.11.1"
},
"devDependencies": {
"@angular-devkit/build-angular": "0.1000.7",
"@angular/compiler": "~10.0.0",
"@angular/compiler-cli": "~10.0.0",
"@angular/language-service": "~10.0.0",
"@capacitor/cli": "2.4.0",
"@ionic/angular-toolkit": "^2.3.0",
"@types/jasmine": "~3.5.0",
"@types/jasminewd2": "~2.0.3",
"@types/mapbox-gl": "^1.11.2",
"@types/node": "^14.6.0",
"codelyzer": "^6.0.0",
"jasmine-core": "~3.6.0",
"jasmine-spec-reporter": "~5.0.0",
"karma": "~5.1.1",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage-istanbul-reporter": "~3.0.2",
"karma-jasmine": "~4.0.1",
"karma-jasmine-html-reporter": "^1.5.0",
"protractor": "~7.0.0",
"ts-node": "~9.0.0",
"tslint": "~6.1.0",
"typescript": "^3.9.7"
},
"description": "An Ionic project"
}
当我运行ng version
时,这是我的输出:
Angular CLI: 9.1.12
Node: 14.8.0
OS: darwin x64
Angular: 9.1.12
... cli, common, core
Ivy Workspace: Yes
Package Version
-------------------------------------------------------------
@angular-devkit/architect 0.1000.8
@angular-devkit/build-angular 0.1000.7
@angular-devkit/build-optimizer 0.1000.8
@angular-devkit/build-webpack 0.1000.8
@angular-devkit/core 10.0.8
@angular-devkit/schematics 9.1.12
@angular/compiler 10.0.14
@angular/compiler-cli 10.0.14
@angular/fire 6.0.2
@angular/forms 10.0.14
@angular/language-service 10.0.14
@angular/platform-browser 10.0.14
@angular/platform-browser-dynamic 10.0.14
@angular/router 10.0.14
@ngtools/webpack 10.0.8
@schematics/angular 9.1.12
@schematics/update 0.901.12
rxjs 6.6.2
typescript 3.9.7
webpack 4.43.0
这是我到目前为止尝试过的:
npm install
ionic serve
时,仍然会收到关于@ angular / fire / database缺少依赖项的错误)