Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tsc.ps1 cannot be loaded. The file ... is not digitally signed #35606

Closed
Houuse opened this issue Dec 10, 2019 · 6 comments
Closed

tsc.ps1 cannot be loaded. The file ... is not digitally signed #35606

Houuse opened this issue Dec 10, 2019 · 6 comments
Labels
External Relates to another program, environment, or user action which we cannot control.

Comments

@Houuse
Copy link

Houuse commented Dec 10, 2019

TypeScript Version: typescript@3.7.3

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
+ typescript@3.7.3
updated 1 package in 0.93s

PS C:\Users\xxx> npm ls -g typescript
C:\Users\xxx\AppData\Roaming\npm
`-- typescript@3.7.3

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

@j-oliveras
Copy link
Contributor

I think that tsc.ps1 is created by npm.

@fatcerberus
Copy link

Duplicate of #35031

@fatcerberus
Copy link

Relevant npm issue is npm/cli#470.

@RyanCavanaugh RyanCavanaugh added the External Relates to another program, environment, or user action which we cannot control. label Dec 10, 2019
@typescript-bot
Copy link
Collaborator

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

@pacis-25
Copy link

pacis-25 commented Aug 1, 2022

just type tsc.cmd the ts filename

@sinaAtabaki
Copy link

or just delete
C:\Users%USERNAME%\AppData\Roaming\npm\tsc.ps1
Now it will automatically load tsc.cmd when you type tsc in the command prompt/ powershell

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
External Relates to another program, environment, or user action which we cannot control.
Projects
None yet
Development

No branches or pull requests

7 participants