2016-04-11 15 views
5

Sono nuovo in TypeScript. Voglio installare una versione specifica del file di definizione angolare alla mia applicazione.Le tipizzazioni installano una versione specifica dei file di definizione

Utilizzando TSD posso utilizzare il comando seguente

tsd install angular -v "1.4.0" -rso 

Dal momento che, TSD è deprecato, ho spostato a typings per automatizzare l'installazione dei file di definizione.

La mia domanda è, usando typings, posso installare una versione particolare del file di definizione angolare? In tal caso, qual è il comando in typings?

Aggiornamento:

ho cercato qui di seguito i comandi, ma non ha funzionato.

typings install [email protected] 

e

typings install [email protected] --ambient 

messaggi l'errore assomigliano:

$ typings install [email protected] --ambient 
typings ERR! message Unable to find "angular" for "dt" in the registry. Did you want to install ambient typings with the ambient flag? If you can contribute these typings, please help us: https://github.com/typings/registry 
typings ERR! caused by https://api.typings.org/entries/dt/angular/versions/1.4.0/latest responded with 404, expected it to equal 200 

typings ERR! cwd /Users/idolezalova/projects/wfm 
typings ERR! system Darwin 15.4.0 
typings ERR! command "/Users/idolezalova/.nvm/versions/node/v4.3.1/bin/node" "/Users/idolezalova/.nvm/versions/node/v4.3.1/bin/typings" "install" "[email protected]" "--ambient" 
typings ERR! node -v v4.3.1 
typings ERR! typings -v 0.7.12 

typings ERR! If you need help, you may report this error at: 
typings ERR! <https://github.com/typings/typings/issues> 
+0

segnalato come un bug https://github.com/typings/typings/issues/442 –

risposta

4

help:

$ typings install -h 

typings install (with no arguments, in package directory) 
typings install <pkg>[@<version>] [ --source [dt | npm | github | bower | common | shared | lib | env | global] ] 
typings install file:<path> 
typings install github:<github username>/<github project>[/<path>][#<commit>] 
typings install bitbucket:<bitbucket username>/<bitbucket project>[/<path>][#<commit>] 
typings install <http:// url> 

Aliases: i, in 
Options: [--name] [--save|--save-dev] [--ambient] [--production] 

Ciò significa che questo comando dovrebbe funzionare (è anche necessario aggiungere --ambient bandiera perché io t non è portato dalla DefinitelyTyped ancora):

typings install [email protected] --ambient 
+0

prega di consultare la domanda aggiornato. – imfarhad

+1

@imfarhad Hmm, vedo. Beh, sembra un bug, lo segnalerei come problema su GitHub. –

+0

Direi che il problema è con il repository DT per [digitazioni angolari] (https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/angularjs). La versione 1.4 si trova all'interno della cartella denominata * legacy *, probabilmente la tipizzazione non sa come gestirla. – goenning

Problemi correlati