'typings' 不是内部或外部命令,也不是可运行的程序或批处理文件 [英] 'typings' is not recognized as an internal or external command, operable program or batch file

查看:157
本文介绍了'typings' 不是内部或外部命令,也不是可运行的程序或批处理文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

自从这个问题被发布以来,类型已经被弃用,而支持@types.

edit: since this question was posted, typings have been deprecated in favor of @types.

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

I'm trying to install typescript typings for my web app, but I can't get command prompt to recognize the typings command.

typings install 抛出以下错误:

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

详情

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

Details

When I run npm i typings -g, the console tells me the module has been installed. But when I look in my global npm directory, there is no typings file.

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.其他所有内容都是逐字复制的.

More Details

my username has been replaced with 123456 for security purposes. everything else is copied verbatim.

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

I don't have admin privileges (i'm on a work machine)

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

where typings also throws an error (INFO: Could not find files for the given pattern(s).

npm -g 适用于 grunt-cli

npm -g worked fine for grunt-cli

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

npm is in my PATH as C:\Users\123456\AppData\Roaming\npm

推荐答案

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

Try to install typings using npm command : npm install typings --global

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

after that execute the typings command. example: typings install dt~hammerjs --save --global

这篇关于'typings' 不是内部或外部命令,也不是可运行的程序或批处理文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆