5

I get this error in my web application

ERROR in node_modules/zone.js/dist/zone.js.d.ts:600:21 - error TS2503: Cannot find namespace 'NodeJS'.

600 declare var global: NodeJS.Global;

As you can see here below i already added the types": ["node"] property but it's still not working

{
  "compileOnSave": false,
  "compilerOptions": {
    "baseUrl": "./",
    "types": ["node"],
    "outDir": "./dist/out-tsc",
    "sourceMap": true,
    "declaration": false,
    "downlevelIteration": true,
    "experimentalDecorators": true,
    "module": "es6",
    "moduleResolution": "node",
    "importHelpers": true,
    "target": "es2015",
    "typeRoots": [
      "node_modules/@types"
    ],
    "lib": [
      "es2018",
      "dom"
    ]
  },
  "angularCompilerOptions": {
    "fullTemplateTypeCheck": true,
    "strictInjectionParameters": true
  }
}

I don't really know how solve it. The applicationn starts the first time getting Cannot GET / and then, after saving whatever file, it works but still with the NodeJS error. Thanks

2 Answers 2

9

For those who have this kind of problem i solved updating zone.js at version "zone.js": "^0.11.1"

Sign up to request clarification or add additional context in comments.

Comments

0

While upgrade angular 8 to 13 i am facing same. Because zone.js not installed to my project. so install zone js the problem resolved.

npm i zone.js

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.