2016-08-02 34 views
0

我將Angular2 beta 15版本更改爲RC版本,並且在運行應用程序時出現一些錯誤。錯誤npm開始使用Angular 2 RC版本

typings/browser/ambient/es6-shim/index.d.ts(8,14): error TS2300: Duplicate identifier 'PropertyKey'. 
typings/browser/ambient/es6-shim/index.d.ts(11,5): error TS2300: Duplicate identifier 'done'. 
typings/browser/ambient/es6-shim/index.d.ts(12,5): error TS2300: Duplicate identifier 'value'. 
typings/browser/ambient/es6-shim/index.d.ts(250,5): error TS2300: Duplicate identifier 'EPSILON'. 
typings/browser/ambient/es6-shim/index.d.ts(285,5): error TS2300: Duplicate identifier 'MAX_SAFE_INTEGER'. 
typings/browser/ambient/es6-shim/index.d.ts(292,5): error TS2300: Duplicate identifier 'MIN_SAFE_INTEGER'. 
typings/browser/ambient/es6-shim/index.d.ts(348,5): error TS2300: Duplicate identifier 'flags'. 
typings/browser/ambient/es6-shim/index.d.ts(500,5): error TS2300: Duplicate identifier 'prototype'. 
typings/browser/ambient/es6-shim/index.d.ts(563,5): error TS2300: Duplicate identifier 'size'. 
typings/browser/ambient/es6-shim/index.d.ts(572,5): error TS2300: Duplicate identifier 'prototype'. 
typings/browser/ambient/es6-shim/index.d.ts(583,5): error TS2300: Duplicate identifier 'size'. 
typings/browser/ambient/es6-shim/index.d.ts(592,5): error TS2300: Duplicate identifier 'prototype'. 
typings/browser/ambient/es6-shim/index.d.ts(607,5): error TS2300: Duplicate identifier 'prototype'. 
typings/browser/ambient/es6-shim/index.d.ts(621,5): error TS2300: Duplicate identifier 'prototype'. 
typings/globals/core-js/index.d.ts(3,14): error TS2300: Duplicate identifier 'PropertyKey'. 
typings/globals/core-js/index.d.ts(217,5): error TS2300: Duplicate identifier 'flags'. 
typings/globals/core-js/index.d.ts(231,5): error TS2300: Duplicate identifier 'EPSILON'. 
typings/globals/core-js/index.d.ts(266,5): error TS2300: Duplicate identifier 'MAX_SAFE_INTEGER'. 
typings/globals/core-js/index.d.ts(273,5): error TS2300: Duplicate identifier 'MIN_SAFE_INTEGER'. 
typings/globals/core-js/index.d.ts(583,5): error TS2300: Duplicate identifier 'size'. 
typings/globals/core-js/index.d.ts(589,5): error TS2300: Duplicate identifier 'prototype'. 
typings/globals/core-js/index.d.ts(600,5): error TS2300: Duplicate identifier 'size'. 
typings/globals/core-js/index.d.ts(606,5): error TS2300: Duplicate identifier 'prototype'. 
typings/globals/core-js/index.d.ts(621,5): error TS2300: Duplicate identifier 'prototype'. 
typings/globals/core-js/index.d.ts(635,5): error TS2300: Duplicate identifier 'prototype'. 
typings/globals/core-js/index.d.ts(646,5): error TS2300: Duplicate identifier 'done'. 
typings/globals/core-js/index.d.ts(647,5): error TS2300: Duplicate identifier 'value'. 
typings/globals/core-js/index.d.ts(759,5): error TS2300: Duplicate identifier 'prototype'. 

你能幫我找到解決這個問題的方法嗎?我是Angular2的一個noob。

我的JSON文件typings.json看起來是這樣的:

{ 
    "ambientDependencies": { 
     "es6-shim": "github:DefinitelyTyped/DefinitelyTyped/es6-shim/es6-shim.d.ts#7de6c3dd94feaeb21f20054b9f30d5dabc5efabd" 
    } 
} 

回答

1

typings.json文件使用棄用的語法:它使用ambientDependencies代替globalDependencies。另外,Angular RC不再使用es6-shim

刪除您的類型文件夾,更新您的typings.json文件並重新安裝。

更新你typings.json如下:

{ 
    "globalDependencies": { 
    "core-js": "registry:dt/core-js#0.0.0+20160602141332", 
    "jasmine": "registry:dt/jasmine#2.2.0+20160621224255", 
    "node": "registry:dt/node#6.0.0+20160621231320" 
    } 
} 
0

在typings.json重命名:

ambientDevDependencies到globalDevDependencies

ambientDependencies到globalDependencies

然後,在控制檯:

個$分型安裝

├──ES6-墊片(全球)

├──角量角器(全球DEV)

├──茉莉(全球DEV)

└──硒webdriver(全球開發)