-4

while creating a new Angular application by running command "ng new my-app"

\ng : File C:\Users\DELL\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 new my-app
+ ~~
   + CategoryInfo          : SecurityError: (:) [], PSSecurityException
   + FullyQualifiedErrorId : UnauthorizedAccess

how to resolve this?

Heretic Monkey
  • 11,687
  • 7
  • 53
  • 122
Prajna
  • 11
  • 1
  • 3
    Please put some effort into solving this yourself. For instance, go to the link provided in the error message and read what is mentioned regarding execution policies. – Heretic Monkey Nov 02 '20 at 14:01
  • 1
    Is this answer your question? https://stackoverflow.com/questions/4037939/powershell-says-execution-of-scripts-is-disabled-on-this-system. First thing after copy your answer and paste it on a search engine – StPaulis Nov 02 '20 at 14:03

3 Answers3

0

I found the solution to this:- delete ng.ps1 (follow path) and then delete npm-cache from roaming then refesh .

Prajna
  • 11
  • 1
0

go to the directory which mention on your terminal(ng : File C:\Users\DELL\AppData\Roaming\npm) and delete the ng.ps1(power shell) file from this directory. and try again to create project. It will work definitely. here is the proof for error

-4

Go to the link suggested, read the documentation and then open the PowerShell as admin and set__Execution_Policies to true.

Elletlar
  • 3,136
  • 7
  • 32
  • 38
Cire
  • 5
  • 3
  • Try avoiding telling a question-asker to essentially "go read the docs." Ideally a StackOverflow answer would provide some explanation as to what they're seeing and how to resolve the issue so that it is useful for the asker and anyone else that might be in the same predicament. – Robert Dean Nov 02 '20 at 19:23