VScode执行tsc xx.ts出现以下错误

简介: VScode执行tsc xx.ts出现以下错误

问题

PS D:\devproject\前端技术\es6> tsc .\hello.ts

tsc : 无法加载文件 C:\Users\elite\AppData\Roaming\npm\tsc.ps1,因为在此系统上禁止运行脚本。有关详细信息,请参阅 https:/go.microsoft.com/fwlink/?LinkID=13517

0 中的 about_Execution_Policies。

所在位置 行:1 字符: 1

tsc .\hello.ts

 + CategoryInfo          : SecurityError: (:) [],PSSecurityException

 + FullyQualifiedErrorId : UnauthorizedAccess

解决授权

75e4ff53c0d548708bca1f8734193475.png

打开执行: set-ExecutionPolicy RemoteSigned

输入全是 A

41ecf279c8e24c2ca9aad0070233ce5d.png

再次执行则ok:

2cf9a57a1eaf47e6a696e5b353dba4d8.png

目录
打赏
0
0
0
0
35
分享
相关文章
TS,编写TS文件,编写hello.ts文件,cmd下打开终端,输入tsc hello.ts会生成一个hello.js文件,简化命令,npm i -g ts-node,ts-node hello.ts
TS,编写TS文件,编写hello.ts文件,cmd下打开终端,输入tsc hello.ts会生成一个hello.js文件,简化命令,npm i -g ts-node,ts-node hello.ts
|
8月前
|
vscode设置 git提交代码忽略node_modules,dist,vscode如何设置不提交node_modules,dist
vscode设置 git提交代码忽略node_modules,dist,vscode如何设置不提交node_modules,dist
785 0
使用TS+rollup打造一个npm工具库
使用TS+rollup打造一个npm工具库
235 0
vue : 无法加载文件 D:\module\npm_module\npm_modules\vue.ps1,因为在此系统上禁止运行脚本。有关详细信息,请参阅 https:/go.microsoft.c
vue : 无法加载文件 D:\module\npm_module\npm_modules\vue.ps1,因为在此系统上禁止运行脚本。有关详细信息,请参阅 https:/go.microsoft.c
# 解决输入任何npm命令都报Error: Cannot find module ‘are-we-there-yet‘
# 解决输入任何npm命令都报Error: Cannot find module ‘are-we-there-yet‘
|
10月前
|
IDA3.12版本的python,依旧报错IDAPython: error executing init.py.No module named ‘impRefer to the message win
IDA3.12版本的python,依旧报错IDAPython: error executing init.py.No module named ‘impRefer to the message win
typescript vscode /bin/sh: ts-node: command not found
typescript vscode /bin/sh: ts-node: command not found
176 0
.ts 文件编译成 .js 文件,以及 VSCode 自动编译配置
.ts 文件编译成 .js 文件,以及 VSCode 自动编译配置
1110 0
解决报错问题:‘ts-node‘ 不是内部或外部命令,也不是可运行的程序或批处理文件。
解决报错问题:‘ts-node‘ 不是内部或外部命令,也不是可运行的程序或批处理文件。
1290 0
AI助理

你好,我是AI助理

可以解答问题、推荐解决方案等