13

I am very new to typescript. Whatever typings I try to install, I get:

typings ERR! message Attempted to compile "angular" as an external module, but it looks like a global module.

I am just trying to do

typings install dt~angular

What am I doing wrong?

Update: If you are coming here with little knowledge (as I was when writing this question) - consider using npm/@types. More info and discussion.

H.B.
  • 166,899
  • 29
  • 327
  • 400
ironic
  • 8,368
  • 7
  • 35
  • 44
  • 1
    i used to install typings using following command:- typings install angular --ambient --save. – Ajay May 21 '16 at 04:09

2 Answers2

17

As error message suggests, you should use --global option:

typings install dt~angular --global --save

See detailed step-by-step tutorial for setting up Node.js project with TypeScript support in IntelliJ IDEA / Webstorm or Visual Studio Code

TypeScript and tools around it are evolving very fast. What worked yesterday don't work any more.

  • 2
    Is there a place with up-to-date description of global modules? At first I thought it is similar npm global, which is not really what I wanted... – ironic May 23 '16 at 05:55
-4

What am I doing wrong?

Global modules need to be compiled with --ambient

typings install angular --ambient --save

You can see more on the need to use ambient here : When to use ambient while searching for a type definition?

Community
  • 1
  • 1
basarat
  • 261,912
  • 58
  • 460
  • 511