How to install .d.ts file from github:DefinitelyTypes using typings
Solution 1
To install angular-formly definitions from DefinitelyTyped, use the following command:
typings install angular-formly --ambient
It's taken directly from here: Quick Start
EDIT: Because this is the accepted answer and syntax has changed, as of typings 1.0:
typings install dt~angular-formly --global
Solution 2
As of version 1.X of typings the syntax has changed and is now:
typings install dt~angular-formly --global
update:
As of typescript 2.0 types are installed using npm:
npm install @types/angular-formly
Solution 3
I use the following:
./node_modules/.bin/typings install whatever --save --global --source dt
Seems to be the way to do it in v1.3.1.
pierrebo
SharePoint Solution Architect and ex-Microsoft guy. Doing SPA development using Angular on SharePoint.
Updated on July 21, 2022Comments
-
pierrebo almost 2 years
I used tsd which is now deprecated and am trying to use typings. The typings repository is very small, and I can't find any of the d.ts files I need. All the files I need are in GitHub DefinitelyTyped repository, but I can't find a way to install them using typings.
Here is a command I tried:
typings install github:DefinitelyTyped/DefinitelyTyped/angular-formly/angular-formly.d.ts
I receive the error:
typings ERR! message Attempted to compile "angular-formly" as a dependency, but it contains some ambient module declarations ("AngularFormly", "angular-formly").
Any clue?
-
pierrebo about 8 yearstry it, it does not work - you receive an error message saying "unable to find angular-formly in the registry". If you look at the typings registry, it has only about 30 entries comared with the multiple hundreds in DefinitelyTypes.
-
Amid about 8 yearsI have tried it before posting. It does work. Moreover if you check the link it explicitly says that by using --ambient flag you will instruct 'typings' to check definately typed for definitions. Your problem is somewhere else.
-
pierrebo about 8 yearsmy bad, you are right (I misspelled ambient to ambiant - the problem being french speaking sometimes!)
-
Bruno Brant about 8 yearsSo, what does the
ambient
flag do that makes it work? -
TommyAutoMagically almost 8 yearsThank you! This isn't well-documented across the web. The typings project documented it well, but of all of the tutorials and SO answers I've read, this is the first I've found that mentions this. Crucial. More info: github.com/typings/typings/releases/tag/v1.0.0
-
spiffytech almost 8 yearsNote the tilde: dt<tilde>angular-formly
-
Neoheurist almost 8 yearsI was motivated to attempt to author something comprehensive related to finding / using typings neoheurist.wordpress.com/2016/06/20/definitely-typed comments and feedback welcome/requested - I want it to be as useful / authoritative as possible
-
JMStudios.jrichardson over 7 yearsThis adds the dependency to the project but apparently you need to instal the dependency manually.... How do you install the dependency manually?
-
Amid over 7 yearsThis adds typescript definitions to the project. Not dependency. If you want to add dependency (whose definitions you had installed with
typings
) - add it topackage.json
->dependencies
and then runnpm install
to fetch it.