Angular Powershell ng.ps1 cannot be loaded and not digitally signed
Today in this article on issue resolution, we will see how to fix the common issue like ng.ps1 cannot be loaded and not digitally signed.
We will cover below aspects,
Issue Description
Angular commands like ng new or ng serve produce PowerShell commands error as below,
ng : File C:\Users\test\AppData\Roaming\npm\ng.ps1 cannot be loaded. The file C:\Users\test\AppData\Roaming\npm\ng.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
Resolution
This issue means your machine is preventing you from running script files.
Implementation of these policies occurs on Windows platforms including Windows client or Windows Server machines.
The PowerShell execution policies are as follows,
- RemoteSigned
- Unrestricted
Steps to resolve the issue
To change the PowerShell execution policy on your Windows computer, use the below command
Step1: Get-ExecutionPolicy for your Machine
Get-ExecutionPolicy -List
Step 2: Set Execution Policy
Once your identity scope and execution policy, please run the below commands using the same.
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
Finally, you shall be all set to run your script (without restarting the PowerShell).
Do you have any comments or ideas or any better suggestions to share?
Please sound off your comments below.
Happy Coding !!
Please bookmark this page and share it with your friends. Please Subscribe to the blog to receive notifications on freshly published(2024) best practices and guidelines for software design and development.
This worked like a charm! Thank you.
Hello Zackary – Thanks, Glad to know it helped you!
thank you It’s working fine.
Hi Hamid- Glad it helped you!
Thank you so much, It’s working fine.
Thanks Salahuddin.Glad it helped you.
Thanks for this!
Thanks Sadiq! Glad it helped you!
Thanks for help, it work for me….! Good Day 🙂
Thankas Vikrant. Glad it helped you!
Thanks, this worked for me.
Thank Soni. Glad it helped you to fix the issue.
Thanks, it worked for me
Thanks Angela. Glad it helped you!
Thank you! It works for me too.
Thanks Anu.Glad it helped you !
Thank you
It works for me
Thanks Soma, Glad it helped you fix the issue
Thank you so much,
it helped me
Thank you, this helped me.
Radhakrishnan- Glad it helped you. Thanks!
Thank you very much, it helped me.
You are welcome Tzur!
It helped me!!Thanks a lot
Thank you Geetha, Glad it helped you!
I did it. tks
You are welcome Nguyên!
It solved my problems. Thanks
Thanks Vaishali, Glad it helped you solve the problem!