Typescript: tsc.ps1 cannot be loaded. The file ... is not digitally signed

Created on 10 Dec 2019  路  4Comments  路  Source: microsoft/TypeScript


TypeScript Version: [email protected]


Search Terms:
tsc.ps1 , tsc not digitaly signed
Code

after fresh install 

PS C:\Users\xxx> npm install -g typescript
C:\Users\xxx\AppData\Roaming\npm\tsc -> C:\Users\xxx\AppData\Roaming\npm\node_modules\typescript\bin\tsc
C:\Users\xxx\AppData\Roaming\npm\tsserver -> C:\Users\xxx\AppData\Roaming\npm\node_modules\typescript\bin\tsserver
+ [email protected]
updated 1 package in 0.93s

PS C:\Users\xxx> npm ls -g typescript
C:\Users\xxx\AppData\Roaming\npm
`-- [email protected]

PS C:\Users\xxx> tsc
tsc : File C:\Users\xxx\AppData\Roaming\npm\tsc.ps1 cannot be loaded. The file
C:\Users\xxx\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
+ ~~~
    + CategoryInfo          : SecurityError: (:) [], PSSecurityException
    + FullyQualifiedErrorId : UnauthorizedAccess

Expected behavior:
the typescript command isn't running at all due that tsc.ps1 isn't digitally signed, my pc execution policy

PS C:\Users\xxx> Get-ExecutionPolicy
AllSigned

Actual behavior:

PS C:\Users\xxx> tsc
tsc : File C:\Users\xxx\AppData\Roaming\npm\tsc.ps1 cannot be loaded. The file
C:\Users\xxx\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
+ ~~~
    + CategoryInfo          : SecurityError: (:) [], PSSecurityException
    + FullyQualifiedErrorId : UnauthorizedAccess

not related directly to ts , it's powershell script not signed issue

Edit , I know this isuue could be worked around by running following command in powershell

PS> Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope LocalMachine

am not security expert but assuming that the user don't have to change their pc execution policy in order to run typescript

External

Most helpful comment

All 4 comments

I think that tsc.ps1 is created by npm.

Duplicate of #35031

This issue has been marked as 'External' and has seen no recent activity. It has been automatically closed for house-keeping purposes.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

weswigham picture weswigham  路  3Comments

DanielRosenwasser picture DanielRosenwasser  路  3Comments

dlaberge picture dlaberge  路  3Comments

kyasbal-1994 picture kyasbal-1994  路  3Comments

uber5001 picture uber5001  路  3Comments