Build:Cannot find type definition file for 'node'

bitshift :

VS 2015 community edition (at home), npm 3.10, Angular 2 Im trying to pull get Angular2 setup within an ASP.Net MVC 5 app. The template I started with used an older version of Angular, so I updated the package references.

When I build, the first error in the list is:
Build:Cannot find type definition file for 'node'
There are dozens of other errors after that but Im assuming most are due to this first issue.

Here is the package.json and typings.json

package.json

{
  "version": "1.0.0",
  "name": "aspnet",
  "private": true,
  "scripts": {
    "postinstall": "typings install",
    "typings": "typings"
  },
  "dependencies": {
    "@angular/common": "~4.0.0",
    "@angular/compiler": "~4.0.0",
    "@angular/core": "~4.0.0",
    "@angular/forms": "~4.0.0",
    "@angular/http": "~4.0.0",
    "@angular/platform-browser": "~4.0.0",
    "@angular/platform-browser-dynamic": "~4.0.0",
    "@angular/router": "~4.0.0",
    "angular-in-memory-web-api": "~0.3.0",
    "systemjs": "0.19.40",
    "core-js": "^2.4.1",
    "rxjs": "5.0.1",
    "zone.js": "^0.8.4",
    "bootstrap": "^3.3.7"
  },
  "devDependencies": {
    "@types/core-js": "^0.9.41",
    "gulp": "^3.9.1",
    "gulp-clean": "^0.3.2",
    "gulp-concat": "^2.6.1",
    "gulp-tsc": "^1.3.1",
    "gulp-typescript": "^3.1.6",
    "path": "^0.12.7",
    "typescript": "~2.1.0",
    "typings": "~2.1.1"
  }
}

typings.json

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

If I try to update just the typings, I get these messages

*typings WARN deprecated 11/21/2016: "registry:dt/node#6.0.0+20160909174046" is deprecated (updated, replaced or removed)
typings WARN deprecated 9/14/2016: "registry:dt/core-js#0.0.0+20160725163759" is deprecated (updated, replaced or removed)
typings WARN deprecated 10/25/2016: "registry:dt/jasmine#2.2.0+20160621224255" is deprecated (updated, replaced or removed)*

[ update ]
cleaning out my node_modules folder, then running npm install again cleared things up. This seems to happen most often when I move a project folder to another location on my system.

argoo :

I had several problems updating packages through visual studio. From now i always update or add packages with the powershell console.

Start PowerShell and navigate to the folder where package.json is located and then run npm install Restart visual studio after the installation is done.

You can also try to delete your node_modules folder then run npm install

Hope this will solve your problems.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

TS2688: Cannot find type definition file for 'node' with @types/node installed

Cannot find type definition file for 'ramda'

Angular 7: cannot find the type definition file

Using Jest I get: Cannot find type definition file for 'jasmine'

Cannot find type definition file for 'core-js'

error TS2688: Cannot find type definition file for 'dist'

error TS2688: Cannot find type definition file for 'bson'

error TS2688: Cannot find type definition file for 'ioredis'

CMake cannot find source file, but file was not specified in CMakeLists.txt, in TFS build definition

XML file, XSD schema Errors: Cannot resolve the name to a(n) 'type definition', Cannot find the declaration of element

Compile on heroku node ts- jest types- cannot find type definition

Typescript cannot find method in definition file

ERROR in error TS2688: Cannot find type definition file for 'jest'

Cannot find type definition file for 'redux-logger' error in tsconfig.json

TypeScript error in undefined(undefined,undefined): Cannot find type definition file for 'src'. TS2688

Docker build cannot find file that is

Heroku - Node.js - React App - Build failed - "Cannot find file"

I cannot find the definition of a method in node.js source code

After typescript update 2.3.4 => 2.4.2 i get compilation error "Cannot find type definition file for 'reflect-metadata'."

Jest fails when trying to find type definition in node_modules

During Heroku Post Build, Cannot find file

Cannot find the definition of a constant

"Cannot find debug adapter for type 'node'. "

TypeScript Definition File Cannot Find .d.ts

Module build failed: Error: Cannot find module 'node-sass'

How can I diagnose this "cannot find type" error in a cargo build?

vercel Cannot find module or type declarations while it works in local build

Package type definition cannot be found

File System (fs) cannot find a file with space in it (Node js)