typescript 如何使用typings安装jquery

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/37409912/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-21 03:31:15  来源:igfitidea点击:

How to install jquery using typings

typescripttypescript-typings

提问by sathishkumar

used:

用过的:

typings install jquery --global

typings ERR! message Unable to find "jquery" ("npm") in the registry. Did you want to try searching another source? Also, if you want contribute these typings, please help us: https://github.com/typings/registry
typings ERR! caused by https://api.typings.org/entries/npm/jquery/versions/latest responded with 404, expected it to equal 200

Could anyone help me.

谁能帮助我。

回答by rapha?λ

Try:

尝试:

typings install dt~jquery --global --save

EDIT:

编辑:

from https://github.com/typings/typings#updating-from-0x-to-10

来自https://github.com/typings/typings#updating-from-0x-to-10

If you want to install from DefinitelyTyped, be explicit (use dt~ --global). For example: typings install dt~angular-component-router --global --save

如果您想从绝对类型安装,请明确(使用 dt~ --global)。例如:typings install dt~angular-component-router --global --save

(see also Fidan Hakaj's comment below)

(另见下面 Fidan Hakaj 的评论)

回答by randominstanceOfLivingThing

If you are using typescript2.0 with the command:

如果您使用带有以下命令的 typescript2.0:

npm install -g [email protected]

npm install -g [email protected]

You can install jquery with the command:

您可以使用以下命令安装 jquery:

npm install --save @types/jquery

npm install --save @types/jquery