Не могу преобразовать скрипт на TypeScript в JavaScript
Я пользуюсь VisualStudio Code установил расширение для ts и js, но почему-то не работает команда.
PS D:\ts> tsc main.ts
tsc : The term 'tsc' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was include
d, verify that the path is correct and try again.
At line:1 char:1
+ tsc main.ts
+ ~~~
+ CategoryInfo : ObjectNotFound: (tsc:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Ответы (1 шт):
Автор решения: esergey
→ Ссылка
Windows не видит ваш tsc.
Установка
npm install -g typescript
Проверка
tsc --version
tsc --help
Если не заработает - надо найти в какую папку npm сохранил tsc и прописать в PATH операционной системы windows.