Repository navigation
tsc.ps1 presence in %appdata%\npm #35031
Description
Activity
- changed the title
[-]tsc.ps1 present %appdata%\npm[/-][+]tsc.ps1 presence %appdata%\npm[/+]on Nov 11, 2019 Looks like the current npm version will include ps1 scripts after installing global packages. I am not sure where to report this to npm. Seems like my other machine also faced this issue after updating npm, which implies all npm global packages will not work by default on Powershell from now without mingling it's security settings.
npm fixed it in 6.13.0 npm/cli#281
npm fixed it in 6.13.0 npm/cli#281
It is not about uninstalling though.
It looks like everyone who is using Powershell(basically all Windows VSC terminal users)from now on needs to set the flag (RemoteSigned?) to use global npm packages.
Ouch. Might want to report this behavior change in the npm/cli repository: https://github.com/npm/cli/issues
- changed the title
[-]tsc.ps1 presence %appdata%\npm[/-][+]tsc.ps1 presence in %appdata%\npm[/+]on Nov 11, 2019 Indeed - just for the heck of it I opened PowerShell just now:
PS C:\Users\fatce> tsc tsc : File C:\Users\fatce\AppData\Roaming\npm\tsc.ps1 cannot be loaded because running scripts is disabled on this system. For more information, see about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170. At line:1 char:1 + tsc + ~~~ + CategoryInfo : SecurityError: (:) [], PSSecurityException + FullyQualifiedErrorId : UnauthorizedAccess
Not very nice, and I use
cmdso I never noticed! This isn't a TypeScript issue, though.- addedExternalRelates to another program, environment, or user action which we cannot control.Relates to another program, environment, or user action which we cannot control.
on Nov 11, 2019 typescript-bot commented
on Nov 14, 2019 ContributorMore actionsThis issue has been marked as 'External' and has seen no recent activity. It has been automatically closed for house-keeping purposes.
I had the same issue. Need to run PowerShell as Admin and set the execution policies. In Win10 updates PowerShell has some restrictions for outer scripts. I've set the rights to the policies, but it didn't worked.
I decided to use Git Bash because it's easier for me and there is no issues.To fix it you have to run the command below to run Set-ExecutionPolicy and change the Execution Policy setting.
open PowerShell
cd C:\Windows\System32>
Set-ExecutionPolicy -Scope Process -ExecutionPolicy BypasstsReacted by Mike GledhillMikeInSwitzerland commented
on Aug 6, 2022 More actionsHaiderlasne had the correct solution (but there was a subtle error)
Set-ExecutionPolicy -Scope Process -ExecutionPolicy BypassReacted by JanReacted by JanThe works for the current session, I just set mine for my local machine
Set-ExecutionPolicy -Scope LocalMachine -ExecutionPolicy Bypass
I am not sure why there are ps1 files for tsc and tsserver and now I longer able to use tsc on PowerShell as I got the error
I tried to install tsc on my other Windows 10 machine, it does not come with ps1 files.
TypeScript Version: Version 3.7.2
Search Terms:
tsc.ps1
tsc.ps1 cannot be loaded because running scripts is disabled on this system