Cannot find namespace NodeJS after webpack upgrade

If you also have tsconfig.app.json in your working directory, try to add the attribute node to the types field. Like:

  {
  "extends": "../tsconfig.json",
  "compilerOptions": {
    "outDir": "../out-tsc/app",
    "module": "es6",
    "baseUrl": "",
    "types": ["node"] --> ADD THIS
  },
  "exclude": [
    "test.ts",
    "**/*.spec.ts"
  ]
}

Adding node to the types didn't work for me, "types": ["node"] but adding to the type roots did

{
  "compilerOptions":
  {
    ...
    "typeRoots": [
    "node_modules/@types"
    ]
  }
}

For [email protected]+, use @types:

npm install -D @types/node @types/jasmine

If you still want to hang on to typings, include typings/index.d.ts to your tsconfig.json:

{
  "include": [
    "typings"
  ],
  // or
 "files": [
    "typings/index.d.ts"
  ]
}