angular2 导入项目 运行报错

本机环境:

C:\Users\Administrator>node -v

v10.16.3

C:\Users\Administrator>npm -v

6.9.0

angular版本:@angular:8.2.4

导入项目,运行的时候报错:

D:\Workspace\Web_Workspack\cncl_web>ng serve
An unhandled exception occurred: Cannot find module '@angular/compiler-cli'
See "C:\Users\ADMINI~1\AppData\Local\Temp\ng-fKL8Bh\angular-errors.log" for further details.

项目:package.json

{
  "name": "bjproject",
  "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": "^6.1.0",
    "@angular/common": "^6.1.0",
    "@angular/compiler": "^6.1.0",
    "@angular/core": "^6.1.0",
    "@angular/forms": "^6.1.0",
    "@angular/http": "^6.1.0",
    "@angular/platform-browser": "^6.1.0",
    "@angular/platform-browser-dynamic": "^6.1.0",
    "@angular/router": "^6.1.0",
    "@types/jquery": "^1.12.4",
    "bootstrap": "^3.3.7",
    "classlist.js": "^1.1.20150312",
    "core-js": "^2.5.4",
    "echarts": "^4.2.0-rc.1",
    "font-awesome": "^4.7.0",
    "jquery": "^1.12.4",
    "ng-zorro-antd": "^1.6.0",
    "ng2-cookies": "^1.0.12",
    "rxjs": "~6.2.0",
    "web-animations-js": "^2.3.1",
    "zone.js": "~0.8.26"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "~0.8.0",
    "@angular/cli": "~6.2.4",
    "@angular/compiler-cli": "^6.1.0",
    "@angular/language-service": "^6.1.0",
    "@types/jasmine": "~2.8.8",
    "@types/jasminewd2": "~2.0.3",
    "@types/node": "~8.9.4",
    "codelyzer": "~4.3.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": "~2.9.2",
    "bootstrap": "^3.3.7"
  }
}

1个回答

helianzunfei
Honey_Rush 这篇文章看过,也试过,不能解决问题
5 个月之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问