简体   繁体   中英

Angular - npm install fails in installing firebase packages

I try to clone the Angular project on my computer:

1) Clone from VCS

2) Hit npm install

3) installation fails

I think this is something related to npm itself so I try to use npm cache clear --force , but no luck!

Package.json File:

{
   ...
 },
 "private": true,
 "dependencies": {
 "@angular/animations": "~7.0.0",
 "@angular/common": "~7.0.0",
 "@angular/compiler": "~7.0.0",
 "@angular/core": "~7.0.0",
 "@angular/fire": "^5.1.0",
 "@angular/forms": "~7.0.0",
 "@angular/http": "~7.0.0",
 "@angular/platform-browser": "~7.0.0",
 "@angular/platform-browser-dynamic": "~7.0.0",
 "@angular/router": "~7.0.0",
 "@auth0/angular-jwt": "^2.0.0",
 "@fortawesome/fontawesome-free": "^5.4.2",
 "@ng-bootstrap/ng-bootstrap": "^3.3.1",
 "@types/underscore": "^1.8.9",
 "angular-custom-dropdown": "^1.1.1",
 "bootstrap": "^4.1.3",
 "core-js": "^2.5.4",
 "firebase": "^5.5.6",
 "ng-sidebar": "^8.0.0",
 "ngx-pagination": "^3.2.1",
 "ngx-progressbar": "^2.1.1",
 "rxjs": "~6.3.3",
 "rxjs-compat": "^6.3.3",
 "underscore": "^1.9.1",
 "zone.js": "~0.8.26"
  },
 "devDependencies": {
 "@angular-devkit/build-angular": "~0.10.0",
 "@angular/cli": "~7.0.2",
 "@angular/compiler-cli": "~7.0.0",
 "@angular/language-service": "~7.0.0",
 "@types/node": "~8.9.4",
 "@types/jasmine": "~2.8.8",
 "@types/jasminewd2": "~2.0.3",
 "codelyzer": "~4.5.0",
 "jasmine-core": "~2.99.1",
 "jasmine-spec-reporter": "~4.2.1",
 "karma": "~3.0.0",
 "karma-chrome-launcher": "~2.2.0",
 "karma-coverage-istanbul-reporter": "~2.0.1",
 "karma-jasmine": "~1.1.2",
 "karma-jasmine-html-reporter": "^0.2.2",
 "protractor": "~5.4.0",
 "ts-node": "~7.0.0",
 "tslint": "~5.11.0",
 "typescript": "~3.1.1"
    }
   }

Error Log:

silly fetchPackageMetaData error for @firebase/database@0.3.6 Unexpected end of JSON input while parsing near '..."integrity":"sha512-S' 2318 

silly fetchPackageMetaData error for @firebase/auth@0.7.9 Unexpected end of JSON input while parsing near '...GRvgXj\nwabz7MB4HnkyR' 2319 

Thank you.

Remove your package-lock.json and do npm install again. You probably have a bad code merge that's why it is not working

降级您的节点版本,然后重试它将起作用

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM