VSCode Terminal Execute tsc Commands Error [Solved]

1. Problem description

When the vscode terminal executes the TSC instruction to compile the TS document, an error is reported as follows:

2. Causes of problems

Vscode terminal cannot use command

3. Solutions

1. Right click the vscode icon and select run as administrator;

2. Run code on vscode terminal

get-ExecutionPolicy

Restricted is displayed, indicating that the terminal is prohibited from using the command;

3. Rerun the code

set-ExecutionPolicy RemoteSigned

4. Execute again at this time

get-ExecutionPolicy

If remotesigned is displayed, it means that the terminal command can be used

4. Implementation effect

Read More: