Donate

TypeScript Bug Or Error: tsc.ps1 cannot be loaded. tsc.ps1 is not digitally signed

Hello,

Another error that I encountered when running TypeScript programs is "tsc : File C:\Users\gregorye\AppData\Roaming\npm\tsc.ps1 cannot be loaded. The file C:\Users\gregorye\AppData\Roaming\npm\tsc.ps1 is not digitally signed. You cannot run this script on the current system.". The full description of the bug is presented below.
tsc : File C:\Users\gregorye\AppData\Roaming\npm\tsc.ps1 cannot be loaded. The file C:\Users\gregorye\AppData\Roaming\npm\tsc.ps1 is not digitally signed. You cannot run this script on the current 
system. For more information about running scripts and setting execution policy, see about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170.
At line:1 char:1
+ tsc -p d:\Greg\Typescript\Ch02\tsconfig.json
+ ~~~
    + CategoryInfo          : SecurityError: (:) [], PSSecurityException
    + FullyQualifiedErrorId : UnauthorizedAccess
The terminal process "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -Command tsc -p d:\Greg\Typescript\Ch02\tsconfig.json" terminated with exit code: 1.

The details of my machine and the packages installed are:
Operating System: Windows 10 Pro
Node.js: 14.16.0
npm version: 6.14.11
Typescript: 4.2.3

The fix to this issue is in this link Github TypeScript Issue 35606. That is to open MS Powershell in Administrator mode and run the command "Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope LocalMachine" in C:\Windows\system32>.
tsc : File C:\Users\username\AppData\Roaming\npm\tsc.ps1 cannot be loaded. The file C:\Users\username\AppData\Roaming\npm\tsc.ps1 is not digitally signed.

Cheers!

Comments

Post a Comment

Donate

Popular Posts From This Blog

WPF CRUD Application Using DataGrid, MVVM Pattern, Entity Framework, And C#.NET

TypeScript Error Or Bug: The term 'tsc' is not recognized as the name of a cmdlet, function, script file, or operable program.

Invalid nested tag div found, expected closing tag input