5

I'm developing a Application using Angular and Typescript. That time i'm facing this error.

Error   21  Cannot find namespace 'angular'.

How to solve this??

4
  • can you add more context? does it say what cant find the namespace? Commented Oct 25, 2017 at 10:13
  • check the order of references Commented Oct 25, 2017 at 10:14
  • are you sure you have installed Angular using npm? Commented Oct 25, 2017 at 10:27
  • This is definitely Angular installation issue. Commented Oct 25, 2017 at 10:32

1 Answer 1

9

Maybe you should add angular types to tsconfig.json as following:

  {
...
"compilerOptions":
    ...
    "types": [
        "angular"
    ],
  }

If that won't work, since typings are deprecated, I suggest you to install @types/angular with npm:

npm install --save-dev @types/angular

and include it as above.

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

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.