npm 在Windows Sandbox中进行全局安装后无法识别tsc

jfewjypa  于 2023-04-21  发布在  Windows
关注(0)|答案(1)|浏览(150)

我在这里告诉全局安装https://code.visualstudio.com/docs/typescript/typescript-compiling

npm install -g typescript

vscode内部和外部都有,尽管安装了tsc --version,但它不工作:则不识别TSC。
我在Windows Sandbox https://learn.microsoft.com/en-us/windows/security/threat-protection/windows-sandbox/windows-sandbox-overview之外没有问题
那么,在这种情况下,有什么解决办法吗?

4ktjp1zp

4ktjp1zp1#

你需要用这个命令更新 typescript

npm install typescript@latest -g

则将识别TSC

tsc --init

来源:https://bobbyhadz.com/blog/typescript-tsc-command-not-found

相关问题