'tsc'不被识别为内部或外部命令,可操作程序或批处理文件[重复]('tsc' is not recognized as an internal or exte

编程入门 行业动态 更新时间:2024-10-24 18:16:28
'tsc'不被识别为内部或外部命令,可操作程序或批处理文件[重复]('tsc' is not recognized as an internal or external command,operable program or batch file [duplicate])

这个问题在这里已经有了答案:

从Windows命令行运行tsc 1答案

我是Typescript的初学者。 首先我创建了“types.ts”,并在index.html文件中引用。 我已经在Visual Studio代码终端窗口中使用npm install -g typescript在全球范围内npm install -g typescript

安装后,当我尝试使用tsc -v ,它给了我错误

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

我搜索并尝试了不同的选项。 我将以下路径添加为环境变量。

C:\用户\\应用程序数据\漫游\故宫\ tsc.cmd

然后我重新启动机器,但它仍然给我同样的错误。

This question already has an answer here:

Running tsc from the Windows command line 2 answers

I am a beginner to Typescript. To begin with I have created "types.ts" and referred in index.html file. And I have installed typescript globally using npm install -g typescript in Visual studio Code terminal window.

After installation when I tried to use tsc -v , It gives me the error

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

I searched and tried different options. I was adding following path as a environment variable.

C:\Users\\AppData\Roaming\npm\tsc.cmd

Then I restarted the machine still it gives me the same error.

最满意答案

最后我找到了我自己的答案。 你可以看下面的URL来了解配置的初始步骤。

打字稿配置

但是我得到的错误是通过向我的环境变量部分添加%APPDATA%\npm来解决的。

Finally I found the answer my self. You can watch the below URL to understand the initial steps of configuration.

Typescript Configuration

But the Error which i got is resolved by adding %APPDATA%\npm to my environment variable section.

更多推荐

本文发布于:2023-08-01 03:43:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1353723.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:不被   可操作   批处理文件   命令   程序

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!