角度数据表:未正确安装“angular / compiler-cli”软件包

时间:2017-08-07 19:22:55

标签: javascript angular angular-cli

我几乎尝试了通过以下资源实现Angular Data Table的所有选项:

每次按照资源中的说明运行npm install后,我都会The "@angular/compiler-cli" package was not properly installed。我也尝试了这些可能的解决方案

即使这些资源帮助其他人解决了他们的问题,我的错误仍然存​​在。每次我收到同样的错误The "@angular/compiler-cli" package was not properly installed.

以下是我尝试过的几件事

  1. 移除node_modules并运行npm install
  2. 安装最新版本的typescript 2.2及以上
  3. 重新安装cli npm install --save-dev @angular/cli@latest
  4. 降级Angular-CLI版本
  5. 我也跟着How to use angular2-data-table,我同意帖子的作者,即使用角度CLI没有关于角度2数据表的好/清晰教程。
  6. 我的代码摘要如下所示

    的package.json

    "dependencies": 
    "@angular/animations": "^4.0.0",
    "@angular/common": "^4.0.0",
    "@angular/compiler": "^4.0.0",
    "angular-datatables": "^4.1.1",
    "@swimlane/ngx-datatable": "^9.3.1",
    "datatables.net": "^1.10.15"
    
    "devDependencies": 
    "@angular/cli": "^1.2.6",
    "@angular/compiler-cli": "^4.2.3",
    "@angular/language-service": "^4.0.0",
    "@types/datatables.net": "^1.10.5",
    "typescript": "~2.3.3"
    

    .angularcli.json

    "index": "index.html",
    "main": "main.ts",
    "polyfills": "polyfills.ts",
    "test": "test.ts",
    "tsconfig": "tsconfig.app.json",
    "testTsconfig": "tsconfig.spec.json"
    

    版本详情

    @angular/cli: 1.2.6
    node: 8.0.0
    os: win32 x64
    @angular/animations: 4.2.3
    @angular/common: 4.2.3
    @angular/compiler: 4.2.3
    @angular/core: 4.2.6
    @angular/forms: 4.2.3
    @angular/http: 4.2.3
    @angular/platform-browser: 4.2.3
    @angular/platform-browser-dynamic: 4.2.3
    @angular/router: 4.2.3
    @angular/cli: 1.2.6
    @angular/compiler-cli: 4.2.3
    @angular/language-service: 4.2.3
    

    任何意见和建议都会非常有帮助。谢谢。

0 个答案:

没有答案