【问题标题】:How to install jquery using typings如何使用打字安装jquery
【发布时间】:2016-09-21 10:49:19
【问题描述】:

使用:

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

谁能帮帮我。

【问题讨论】:

    标签: typescript typescript-typings


    【解决方案1】:

    试试:

    typings install dt~jquery --global --save
    

    编辑:

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

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

    (另见下面 Fidan Hakaj 的评论)

    【讨论】:

    • 但这到底是什么意思?
    • @Andrey 它代表绝对类型。在类型自述文件中看到:如果你想从 DefinitiveTyped 安装,请明确(使用 dt~ --global)。 github.com/typings/typings#updating-from-0x-to-10
    • 我现在如何使用它?我仍然没有看到 jquery*.ts 文件
    • @PhilippMunin 这会在typings/global/jquery 中安装.d.ts
    【解决方案2】:

    如果你使用 typescript2.0 的命令:

    npm install -g typescript@2.0

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

    npm install --save @types/jquery

    【讨论】:

    猜你喜欢
    • 2012-07-24
    • 2016-07-02
    • 1970-01-01
    • 2018-05-27
    • 2011-02-04
    • 2017-08-11
    • 2023-03-28
    • 1970-01-01
    • 2022-08-12
    相关资源
    最近更新 更多