VS2015: "Unable to find type definition" and "File not found"

I have an Angular2 application that worked fine up to two days ago. When I tried to build the solution in Visual Studio 2015, I got 10 errors:

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. 

And 6 more about various files in ng2-translate were not found.

Surprisingly, when I create the application with the dotnet run command, it works well. I updated everything on npm-check-updates -u but didn't change anything. My .json package:

 { "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" } } 

What could be causing these errors? N

+1
source share
1 answer

As the error clearly states, you do not need type definitions for hammerjs and jasmine. You can either add them to the typing definition file or install type packages directly:

 npm install --save @types/hammerjs npm install --save @types/jasmine 
+2
source

Source: https://habr.com/ru/post/1014382/


All Articles