angular-cli最新发布的angular应用程序未成功编译json包

时间:2019-03-29 11:52:51

标签: angular npm angular-cli babel

我尝试使用angular-cli创建一个新的角度应用程序。我在npm软件包安装中遇到了这个问题。

当我尝试使用angular-cli创建新的angular应用程序并开始安装npm软件包时,遇到了以下错误。

获取以下错误:

npm ERR! code ETARGET
npm ERR! notarget No matching version found for @babel/helper-split-export-declaration@^7.4.0
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.
npm ERR! notarget
npm ERR! notarget It was specified as a dependency of '@babel/traverse'
npm ERR! notarget

package.json内容如下

{
  "name": "sample-angular-app",
  "version": "0.0.0",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "~7.2.0",
    "@angular/common": "~7.2.0",
    "@angular/compiler": "~7.2.0",
    "@angular/core": "~7.2.0",
    "@angular/forms": "~7.2.0",
    "@angular/platform-browser": "~7.2.0",
    "@angular/platform-browser-dynamic": "~7.2.0",
    "@angular/router": "~7.2.0",
    "core-js": "^2.5.4",
    "rxjs": "~6.3.3",
    "tslib": "^1.9.0",
    "zone.js": "~0.8.26"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "~0.13.0",
    "@angular/cli": "~7.3.6",
    "@angular/compiler-cli": "~7.2.0",
    "@angular/language-service": "~7.2.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": "~4.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.2.2"
  }
}

2 个答案:

答案 0 :(得分:0)

尝试删除 package-lock.json 并运行npm install && npm update,它将安装最新版本。可能有用。

答案 1 :(得分:0)

可以尝试吗?

  1. 以管理员身份提示命令
  2. npm删除
  3. npm安装 4.npm更新