我想在一個項目上運行的WebPack和我得到了多個錯誤找不到名稱「PROPERTYKEY」
node_modules/@types/core-js/index.d.ts
error TS2304: Cannot find name 'PropertyKey'.
...
node_modules/@types/core-js/index.d.ts
error TS2339: Property 'for' does not exist on type 'SymbolConstructor'.
我應該安裝所有的分型,所以我不知道在哪裏,這些都來自哪裏。我試圖從一個編譯的項目拷貝package.json,但它沒有幫助。我錯過了什麼?
我tsconfig看起來像這樣
{
"compilerOptions": {
"target": "es5",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"sourceMap": true,
"noImplicitAny": false,
"suppressImplicitAnyIndexErrors": true
},
"include": [
"src/**/*"
],
"exclude": [
"node_modules",
"**/*.spec.ts"
]
}
它適合我。但是,我有兩臺電腦運行VS2015 Pro與最新的更新和包,一個有問題,可以通過這個答案解決,而另一個不需要。有點奇怪。 – ZZZ
也許你沒有在正確的位置查找tsconfig?或者,也許有一個有升級版本的類型,另一個有另一個。 – Jackie
更改爲ES6不會中斷IE 11操作嗎?換句話說,ES6和瀏覽器合規性的後果是什麼? – Brandon