0

When I have to run my Angular project or any ng command, the system shows the below error:

ng : File C:\Users\achra\AppData\Roaming\npm\ng.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

  • ng v
  • ~~
    • CategoryInfo : SecurityError: (:) [], PSSecurityException
    • FullyQualifiedErrorId : UnauthorizedAccess

Any Solution... I'm new on Angular and i have just started to learn !

Thanks for your attention. I’m looking forward to your answers.

SmileDev94
  • 34
  • 5

1 Answers1

3

First, you have to need to open the command prompt and run this command.

set-ExecutionPolicy RemoteSigned -Scope CurrentUser 

Now you have to run the second command on your system. This command is:

Get-ExecutionPolicy

When you have run this command your system has a show “RemoteSigned”. If you have received this message, then your problem will be solved. Now you have to go to the next step to view the list of policy which policy has been updated by the last commands.

To view their policy, you need to run this command in your command prompt:

Get-ExecutionPolicy -list  

When you run this command, a few policies are shown on your monitor screen.

Now you can see your system execution policy list. You have successfully solved your problem. Now you need to go to the command prompt and check that your problem is solved.

AchrafBj
  • 1,032
  • 6
  • 14