An error is reported when compiling the TS file with TSC.TSC: the file cannot be loaded because running scripts is prohibited on this system; SecurityError
An error is reported when compiling the TS file with the TSC command in the vscode console or windows PowerShell.TSC: the file cannot be loaded because running scripts is prohibited on this system; SecurityError
Run PowerShell
as an administrator and execute the command set executionpolicy
remotesigned to change the execution policy of PowerShell to remotesigned
Use the Win + x
shortcut key to open the shortcut window and click windows PowerShell (administrator) (a) to open windows PowerShell
Run the set executionpolicy remotesigned
command, and select y or a when asking to change the execution policy
Reopen vscode or windows PowerShell, and use TSC - V
to stop reporting errors. You can also compile TS files.
Similar Posts:
- [Solved] yarn: Unable to load the File C:\Users\Administrator\AppData\Roaming\npm\yarn.ps1, Because running scripts is prohibited on this system.
- [Solved] Vue : The file D:\Program Files\nodejs\node_global\vue.ps1 could not be loaded, because running scripts is disabled on this system.
- [Solved] PowerShell Error: the script is prohibited from running on this system
- [Solved] Failed to load the file C:\Users\Administrator\AppData\Roaming\npm\yarn.ps1, because script execution is prohibited in this system.
- Error when opening windows PowerShell modules
- Gulp Serve Error: gulp.ps1 [How to Solve]
- Solve the problem that vs code cannot run the script
- [Solved] VScode cmpm Error: cnmp: Cannot Loading the File…
- An error is reported when running cnpm in vscode, indicating that the script cannot be run
- Modify the script execution permission of PowerShell, and solve the problem of error reporting of commands executed by built-in terminals such as vscode (XX cannot recognize the name of cmdlets, functions, script files or runnable programs)