2016-09-01 141 views
8

我升級了Node和NPM並重新安裝了Angular CLI(angular-cli: 1.0.0-beta.11-webpack.8, node: 6.5.0, os: linux x64),生成了一個foo項目,它工作正常。然後我將Angular 2撞到了RC.6並得到了這個錯誤:@ angular/forms通用類型'類型<T>'需要1個類型參數

[email protected]:~/src/fm-repos/foo> ng serve 
ERROR in [default] /home/jan/src/fm-repos/foo/node_modules/@angular/forms/src/directives.d.ts:26:45 
Generic type 'Type<T>' requires 1 type argument(s). 

ERROR in [default] /home/jan/src/fm-repos/foo/node_modules/@angular/forms/src/directives.d.ts:27:49 
Generic type 'Type<T>' requires 1 type argument(s). 

ERROR in [default] /home/jan/src/fm-repos/foo/node_modules/@angular/forms/src/directives.d.ts:28:49 
Generic type 'Type<T>' requires 1 type argument(s). 

ERROR in [default] /home/jan/src/fm-repos/foo/node_modules/@angular/forms/src/directives.d.ts:46:38 
Generic type 'Type<T>' requires 1 type argument(s). 

ERROR in [default] /home/jan/src/fm-repos/foo/node_modules/@angular/forms/src/directives.d.ts:50:47 
Generic type 'Type<T>' requires 1 type argument(s). 

ERROR in [default] /home/jan/src/fm-repos/foo/node_modules/@angular/forms/src/directives/select_multiple_control_value_accessor.d.ts:12:17 
Generic type 'Type<T>' requires 1 type argument(s). 

ERROR in [default] /home/jan/src/fm-repos/foo/node_modules/@angular/forms/src/form_providers.d.ts:13:37 
Generic type 'Type<T>' requires 1 type argument(s). 

ERROR in [default] /home/jan/src/fm-repos/foo/node_modules/@angular/forms/src/form_providers.d.ts:18:46 
Generic type 'Type<T>' requires 1 type argument(s). 
Child html-webpack-plugin for "index.html": 
     Asset  Size Chunks  Chunk Names 
    index.html 2.81 kB  0  
webpack: bundle is now VALID. 

任何想法如何解決這個問題?這裏是我的package.json

{ "name": "foo", "version": "0.0.0", "license": "MIT", 
    "angular-cli": {}, 
    "scripts": { 
     "start": "ng serve", 
     "lint": "tslint \"src/**/*.ts\"", 
     "test": "ng test", 
     "pree2e": "webdriver-manager update", 
     "e2e": "protractor"}, 
    "private": true, 
"dependencies": { 
    "@angular/common": "2.0.0-rc.6", 
    "@angular/compiler": "2.0.0-rc.6", 
    "@angular/core": "2.0.0-rc.6", 
    "@angular/forms": "0.3.0", 
    "@angular/http": "2.0.0-rc.6", 
    "@angular/platform-browser": "2.0.0-rc.6", 
    "@angular/platform-browser-dynamic": "2.0.0-rc.6", 
    "@angular/router": "3.0.0-rc.2", 
    "core-js": "^2.4.0", 
    "rxjs": "5.0.0-beta.11", 
    "ts-helpers": "^1.1.1", 
    "zone.js": "0.6.12"}, 
"devDependencies": { 
    "@types/jasmine": "^2.2.30", 
    "angular-cli": "1.0.0-beta.11-webpack.8", 
    "codelyzer": "~0.0.26", 
    "jasmine-core": "2.4.1", 
    "jasmine-spec-reporter": "2.5.0", 
    "karma": "0.13.22", 
    "karma-chrome-launcher": "0.2.3", 
    "karma-jasmine": "0.3.8", 
    "karma-remap-istanbul": "^0.2.1", 
    "protractor": "4.0.3", 
    "ts-node": "1.2.1", 
    "tslint": "3.13.0", 
    "typescript": "2.0.0"} 
} 

回答

14

更新@angular/form版本2.0.0-rc.6。 Angular版本現在與其他大多數@angular模塊版本匹配。

相關問題