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
I think that tsc.ps1 is created by npm.
Duplicate of #35031
Relevant npm issue is https://github.com/npm/cli/issues/470.
This issue has been marked as 'External' and has seen no recent activity. It has been automatically closed for house-keeping purposes.
Most helpful comment
Relevant npm issue is https://github.com/npm/cli/issues/470.