2016-11-05 66 views
0

我下载了angular.io“英雄之旅”的最终plunk,但我遇到了错误。我使用第一个plunk中的package.json文件,因为最终的plunk中没有提供package.json文件。 npm start会返回下面的错误。这是今天晚上的新鲜事。我搜索了一些这些错误,并看到了一些我尝试过的建议,但错误仍然存​​在。任何想法如何解决?当我尝试运行angular.io“英雄之旅”时遇到错误最终plunk

app/app.component.ts(4,13): error TS2304: Cannot find name 'module'. 
app/dashboard.component.ts(8,13): error TS2304: Cannot find name 'module'. 
app/hero-detail.component.ts(9,13): error TS2304: Cannot find name 'module'. 
app/hero-search.component.ts(10,13): error TS2304: Cannot find name 'module'. 
app/heroes.component.ts(8,13): error TS2304: Cannot find name 'module'. 
node_modules/@types/core-js/index.d.ts(21,14): error TS2300: Duplicate identifier 'PropertyKey'. 
node_modules/@types/core-js/index.d.ts(85,5): error TS2687: All declarations of 'name' must have identical modifiers. 
node_modules/@types/core-js/index.d.ts(145,5): error TS2403: Subsequent variable declarations must have the same type. Variable '[Symbol.unscopables]' must be of type '{ copyWithin: boolean; entries: boolean; fill: boolean; find: boolean; findIndex: boolean; keys: ...', but here has type 'any'. 
node_modules/@types/core-js/index.d.ts(262,5): error TS2687: All declarations of 'flags' must have identical modifiers. 
node_modules/@types/core-js/index.d.ts(276,5): error TS2687: All declarations of 'EPSILON' must have identical modifiers. 
node_modules/@types/core-js/index.d.ts(311,5): error TS2687: All declarations of 'MAX_SAFE_INTEGER' must have identical modifiers. 
node_modules/@types/core-js/index.d.ts(318,5): error TS2687: All declarations of 'MIN_SAFE_INTEGER' must have identical modifiers. 
node_modules/@types/core-js/index.d.ts(457,5): error TS2403: Subsequent variable declarations must have the same type. Variable '[Symbol.toStringTag]' must be of type '"Symbol"', but here has type 'string'. 
node_modules/@types/core-js/index.d.ts(457,5): error TS2687: All declarations of '[Symbol.toStringTag]' must have identical modifiers. 
node_modules/@types/core-js/index.d.ts(464,5): error TS2687: All declarations of 'prototype' must have identical modifiers. 
node_modules/@types/core-js/index.d.ts(492,5): error TS2687: All declarations of 'hasInstance' must have identical modifiers. 
node_modules/@types/core-js/index.d.ts(498,5): error TS2687: All declarations of 'isConcatSpreadable' must have identical modifiers. 
node_modules/@types/core-js/index.d.ts(504,5): error TS2687: All declarations of 'iterator' must have identical modifiers. 
node_modules/@types/core-js/index.d.ts(510,5): error TS2687: All declarations of 'match' must have identical modifiers. 
node_modules/@types/core-js/index.d.ts(516,5): error TS2687: All declarations of 'replace' must have identical modifiers. 
node_modules/@types/core-js/index.d.ts(522,5): error TS2687: All declarations of 'search' must have identical modifiers. 
node_modules/@types/core-js/index.d.ts(528,5): error TS2687: All declarations of 'species' must have identical modifiers. 
node_modules/@types/core-js/index.d.ts(534,5): error TS2687: All declarations of 'split' must have identical modifiers. 
node_modules/@types/core-js/index.d.ts(540,5): error TS2687: All declarations of 'toPrimitive' must have identical modifiers. 
node_modules/@types/core-js/index.d.ts(546,5): error TS2687: All declarations of 'toStringTag' must have identical modifiers. 
node_modules/@types/core-js/index.d.ts(552,5): error TS2687: All declarations of 'unscopables' must have identical modifiers. 
node_modules/@types/core-js/index.d.ts(609,5): error TS2403: Subsequent variable declarations must have the same type. Variable '[Symbol.toStringTag]' must be of type '"Math"', but here has type 'string'. 
node_modules/@types/core-js/index.d.ts(609,5): error TS2687: All declarations of '[Symbol.toStringTag]' must have identical modifiers. 
node_modules/@types/core-js/index.d.ts(613,5): error TS2403: Subsequent variable declarations must have the same type. Variable '[Symbol.toStringTag]' must be of type '"JSON"', but here has type 'string'. 
node_modules/@types/core-js/index.d.ts(613,5): error TS2687: All declarations of '[Symbol.toStringTag]' must have identical modifiers. 
node_modules/@types/core-js/index.d.ts(628,5): error TS2687: All declarations of 'size' must have identical modifiers. 
node_modules/@types/core-js/index.d.ts(634,5): error TS2687: All declarations of 'prototype' must have identical modifiers. 
node_modules/@types/core-js/index.d.ts(645,5): error TS2687: All declarations of 'size' must have identical modifiers. 
node_modules/@types/core-js/index.d.ts(651,5): error TS2687: All declarations of 'prototype' must have identical modifiers. 
node_modules/@types/core-js/index.d.ts(666,5): error TS2687: All declarations of 'prototype' must have identical modifiers. 
node_modules/@types/core-js/index.d.ts(680,5): error TS2687: All declarations of 'prototype' must have identical modifiers. 
node_modules/@types/core-js/index.d.ts(692,5): error TS2687: All declarations of 'value' must have identical modifiers. 
node_modules/@types/core-js/index.d.ts(804,5): error TS2687: All declarations of 'prototype' must have identical modifiers. 
node_modules/typescript/lib/lib.es6.d.ts(4133,14): error TS2300: Duplicate identifier 'PropertyKey'. 

回答

1

在你tsconfig.json你需要添加

"exclude": [ 
    "node_modules", 
    "typings" 
] 

,所以它不会尝试编译node_modules和分型的文件夹。

+1

对我不起作用,没有任何变化 – iJungleBoy

+0

@iJungleBoy你能给出更多的细节,哪些不起作用,错误是什么? – taropoo

+0

我必须再看一遍。从我记得它有点来回,我相信它就像“如果你尝试AoT,它失败了,找到堆栈溢出的解决方案,应用它,然后你会得到非AoT中的所有错误“ 或者其他的东西。但我再也看不到这个星期左右。 thx为快速回复 – iJungleBoy

1
  1. 删除@类型/芯-JS通过运行下面的命令: “NPM卸载@类型/芯-JS”

  2. 然后安装芯-JS通过运行下面的命令: “NPM安装核心JS --save”

0

删除%LOCALAPPDATA%\微软\打字稿,然后运行:NPM安装-g [email protected]

相关问题