1
我有一個Angular2應用程序,它工作得很好,直到兩天前。當我試圖建立在Visual Studio 2015的解決方案,我得到了10個錯誤:在VS2015:「無法找到類型定義」和「文件未找到」錯誤
Build: Cannot find type definition file for 'hammerjs'.
Build: Cannot find type definition file for 'jasmine'.
Build: File (...)/wwwroot/lib/ng2-translate/index.ts' not found.
而且6個有關各種文件NG2-翻譯沒有找到。
令人驚訝的是,當我通過dotnet run命令構建我的應用程序時,它運行良好。 我通過npm-check-updates -u
更新了所有內容,但並沒有改變任何內容。 我的package.json:
{
"version": "1.0.0",
"name": "CarMarket",
"private": true,
"dependencies": {
"@angular/common": "~4.0.3",
"@angular/compiler": "~4.0.3",
"@angular/core": "~4.0.3",
"@angular/forms": "~4.0.3",
"@angular/http": "~4.0.3",
"@angular/platform-browser": "~4.0.3",
"@angular/platform-browser-dynamic": "~4.0.3",
"@angular/router": "~4.0.3",
"@angular/upgrade": "~4.0.3",
"angular-in-memory-web-api": "~0.3.1",
"body-parser": "1.17.1",
"bootstrap": "3.3.7",
"chart.js": "^2.5.0",
"core-js": "^2.4.1",
"es6-shim": "^0.35.0",
"fancybox": "3.0.0",
"jquery": "3.2.1",
"ng2-charts": "^1.5.0",
"ng2-translate": "^5.0.0",
"reflect-metadata": "^0.1.8",
"rxjs": "5.3.0",
"systemjs": "0.20.12",
"zone.js": "^0.8.9"
},
"devDependencies": {
"@types/node": "^7.0.13",
"del": "2.2.2",
"gulp": "3.9.1",
"gulp-typescript": "3.1.6",
"gulp-watch": "4.3.11",
"merge": "1.2.0",
"typescript": "^2.0.10",
"typings": "^2.1.1"
},
"scripts": {
"postinstall": "typings install"
}
}
可能是什麼造成這些錯誤的原因是什麼? H
我解決它已經但是這不是一個問題 - 實際添加'真 TypeScriptCompileBlocked>'到.xproj使它工作。但是,謝謝你的回答! –
Ania
不客氣,很高興你能夠自己解決它! –