我试图在我的Angular 8应用程序上使用firebase。
我删除了我的node_modules 运行npm install 运行npm install --save firebase @ angular / fire 运行npm run build
我收到以下错误
node_modules / firebase / nidex.d.ts(4396,38)中的错误:错误TS1005:';'预期的
我尝试了其他帖子中的一些步骤,但尚未成功。任何帮助表示赞赏。
我的节点版本是v10.16.3
这是我的package.json
{
"name": "material-dashboard-angular",
"version": "2.1.0",
"license": "MIT",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"@agm/core": "1.0.0-beta.2",
"@angular/animations": "5.2.9",
"@angular/cdk": "5.2.4",
"@angular/common": "5.2.9",
"@angular/compiler": "5.2.9",
"@angular/core": "5.2.9",
"@angular/fire": "^5.2.1",
"@angular/forms": "5.2.9",
"@angular/http": "5.2.9",
"@angular/material": "5.2.4",
"@angular/platform-browser": "5.2.9",
"@angular/platform-browser-dynamic": "5.2.9",
"@angular/platform-server": "5.2.9",
"@angular/router": "5.2.9",
"ajv": "6.4.0",
"arrive": "2.4.1",
"bootstrap": "4.1.0",
"bootstrap-material-design": "4.1.1",
"bootstrap-notify": "3.1.3",
"chartist": "0.11.0",
"classlist.js": "1.1.20150312",
"core-js": "2.4.1",
"firebase": "^7.3.0",
"googleapis": "28.1.0",
"hammerjs": "2.0.8",
"jquery": "3.2.1",
"moment": "2.18.1",
"perfect-scrollbar": "1.1.0",
"popper.js": "1.14.3",
"rxjs": "5.5.10",
"web-animations-js": "2.3.1",
"zone.js": "0.8.4"
},
"devDependencies": {
"@angular/cli": "1.7.4",
"@angular/compiler-cli": "5.2.9",
"@angular/language-service": "5.2.9",
"@types/bootstrap": "3.3.32",
"@types/chartist": "0.9.34",
"@types/googlemaps": "^3.30.8",
"@types/jasmine": "2.5.38",
"@types/jquery": "1.10.31",
"@types/node": "6.0.73",
"codelyzer": "4.2.1",
"jasmine-core": "3.1.0",
"jasmine-spec-reporter": "4.2.1",
"karma": "2.0.0",
"karma-chrome-launcher": "2.2.0",
"karma-cli": "1.0.1",
"karma-coverage-istanbul-reporter": "1.4.2",
"karma-jasmine": "1.1.1",
"protractor": "5.3.1",
"ts-node": "5.0.1",
"tslint": "5.9.1",
"typescript": "2.4.2"
}
}
答案 0 :(得分:2)
npm i angularfire2@5.0.0-rc.7 firebase@4.12.1 --save
对于ionic3,这些版本彼此兼容
答案 1 :(得分:1)
您已经安装了Angular 5而不是8。这就是在angular 8中的依赖关系的样子:
"dependencies": {
"@angular/animations": "~8.2.8",
"@angular/cdk": "~8.2.2",
"@angular/common": "~8.2.8",
"@angular/compiler": "~8.2.8",
"@angular/core": "~8.2.8",
"@angular/fire": "^5.2.1",
"@angular/forms": "~8.2.8",
"@angular/material": "^8.2.2",
"@angular/platform-browser": "~8.2.8",
"@angular/platform-browser-dynamic": "~8.2.8",
"@angular/router": "~8.2.8",
"firebase": "^7.1.0",
"hammerjs": "^2.0.8",
"rxjs": "~6.4.0",
"tslib": "^1.10.0",
"zone.js": "~0.9.1"
}
忘记了devDependencies:
"devDependencies": {
"@angular-devkit/build-angular": "~0.803.6",
"@angular/cli": "~8.3.6",
"@angular/compiler-cli": "~8.2.8",
"@angular/language-service": "~8.2.8",
"@types/jasmine": "~3.3.8",
"@types/jasminewd2": "~2.0.3",
"@types/node": "~8.9.4",
"codelyzer": "^5.0.0",
"jasmine-core": "~3.4.0",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~4.1.0",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "~2.0.1",
"karma-jasmine": "~2.0.1",
"karma-jasmine-html-reporter": "^1.4.0",
"protractor": "~5.4.0",
"ts-node": "~7.0.0",
"tslint": "~5.15.0",
"typescript": "~3.5.3"
}