I cannot run typescript on my system node

I keep getting this error message when i try to run my typescript program on node. please, how do i fix this?

tsc : File C:\Users\USER\AppData\Roaming\npm\tsc.ps1 cannot be loaded because running scripts is disabled on this system.

Hi can you open command prompt and type the below command. What output is being printed?

powershell Get-ExecutionPolicy

It printed ā€œrestrictedā€. How do i handle this?

Hi please execute the below command in command prompt. This will set the script execution policy for the current user. After execution you will be prompted to confirm, just type ā€œYā€ and enter. If you would like to set it for all users on the system then replace ā€˜CurrentUserā€™ with ā€˜LocalMachineā€™. If you are having permission issues then run command prompt as administrator. Be aware that running scripts can have security implications so donā€™t run any from unknown or untrusted sources.

powershell Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser

Thank you so much, it has been resolved.

1 Like