2016-04-11 6 views
5

Ich bin neu in TypeScript. Ich möchte eine bestimmte Version der eckigen Definitionsdatei in meiner Anwendung installieren.Types installieren bestimmte Version von Definitionsdateien

Mit TSD kann ich den folgenden Befehl

tsd install angular -v "1.4.0" -rso 

Da TSD veraltet ist, ich zu typings verschoben haben die Definitionsdateien Installation zu automatisieren.

Meine Frage ist, mit typings, kann ich eine bestimmte Version der eckigen Definitionsdatei installieren? Wenn ja, was ist der Befehl in typings?

Update:

ich unten Befehle versucht, aber sie funktionierte nicht.

typings install [email protected] 

und

typings install [email protected] --ambient 

Die Fehlermeldungen wie folgt aussehen:

$ 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

Berichtet als Bug https://github.com/typings/typings/issues/442 –

Antwort

4

Von Hilfe:

$ 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] 

, dass dieser Befehl bedeutet, sollte funktionieren (Sie müssen auch hinzufügen --ambient flagge weil ich t nicht von DefinitelyTyped noch portiert):

typings install [email protected] --ambient 
+0

Bitte sehen Sie die aktualisierte Frage. – imfarhad

+1

@imfarhad Hmm, ich verstehe. Nun, es scheint wie ein Fehler, ich würde es als Problem auf GitHub melden. –

+0

Ich würde sagen, dass das Problem mit DT-Repository für [eckige Typings] (https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/angularjs) ist. Die Version 1.4 befindet sich in einem Ordner namens * legacy *, mit dem Typings wahrscheinlich nicht vertraut ist. – goenning

Verwandte Themen