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

↘锁芯ラ 提交于 2019-12-10 15:18:43

问题


Summary

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

The Problem

typings install throws the following error:

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

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

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 also throws an error (INFO: Could not find files for the given pattern(s).

npm -g worked fine for grunt-cli

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


回答1:


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

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




回答2:


Typings is deprecated in favor of NPM @types -- see README for more information

Link: https://www.npmjs.com/package/typings

Solution:

Install @types/npm Link: https://www.npmjs.com/package/@types/npm



来源:https://stackoverflow.com/questions/43643581/typings-is-not-recognized-as-an-internal-or-external-command-operable-program

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!