【问题标题】:'typings' is not recognized as an internal or external command, operable program or batch file'typings' 不是内部或外部命令、可运行程序或批处理文件
【发布时间】:2017-04-26 20:04:32
【问题描述】:

编辑:自发布此问题以来,不推荐使用类型以支持@types。


总结

我正在尝试为我的网络应用程序安装 typescript 类型,但我无法让命令提示符识别 typings 命令。

问题

typings install 抛出以下错误:

'typings' is not recognized as an internal or external command,
operable program or batch file.

详情

当我运行npm i typings -g 时,控制台告诉我模块已安装。但是当我查看我的全局 npm 目录时,没有打字文件。

C:\gitdev\MyWebApp\src\main\webapp\myUI>npm i typings -g
C:\home\123456\AppData\Roaming\npm\typings -> C:\home\123456\AppData\Roaming\npm\node_modules\typings\dist\bin.js
C:\home\123456\AppData\Roaming\npm
`-- typings@2.1.1

更多详情

出于安全考虑,我的用户名已替换为 123456。其他所有内容都是逐字复制的。

我没有管理员权限(我在工作机器上)

where typings 也会引发错误(信息:找不到给定模式的文件。

npm -g 适用于 grunt-cli

npm 在我的路径中为C:\Users\123456\AppData\Roaming\npm

【问题讨论】:

    标签: npm npm-install


    【解决方案1】:

    尝试使用 npm 命令安装类型:npm install typings --global

    然后执行打字命令。 例如:typings install dt~hammerjs --save --global

    【讨论】:

    • npm WARN deprecated typings@2.1.1: Typings 已被 NPM @types 取代——更多信息请参见自述文件
    【解决方案2】:

    不推荐使用 Typings 以支持 NPM @types -- 请参阅 README 了解更多信息

    链接:https://www.npmjs.com/package/typings

    解决方案

    安装@types/npm 链接:https://www.npmjs.com/package/@types/npm

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-08-25
      • 2014-06-01
      • 2022-01-06
      • 2016-07-07
      • 2021-12-20
      • 2016-12-03
      • 2019-04-25
      • 2015-05-16
      相关资源
      最近更新 更多