javascript - I am trying to create react app but keeps on telling me unauthorized access - Stack Overflow

PS C:UsersBonnie_PyDesktopfullstack js>create-react-appreact-app create-react-app : File C:U

PS C:\Users\Bonnie_Py\Desktop\fullstack js>  create-react-app
react-app create-react-app : File C:\Users\Bonnie_Py Dev\AppData\Roaming\npm\create-react-app.ps1 
cannot be loaded because running scripts is disabled on this system.  For more information, see about_Execution_Policies at
https:/go.microsoft/fwlink/?LinkID=135170.

At line:1 char:2
 +  create-react-app react-app
 +  ~~~~~~~~~~~~~~~~
     + CategoryInfo          : SecurityError: (:) [], PSSecurityException
     + FullyQualifiedErrorId : UnauthorizedAccess
PS C:\Users\Bonnie_Py\Desktop\fullstack js>  create-react-app
react-app create-react-app : File C:\Users\Bonnie_Py Dev\AppData\Roaming\npm\create-react-app.ps1 
cannot be loaded because running scripts is disabled on this system.  For more information, see about_Execution_Policies at
https:/go.microsoft./fwlink/?LinkID=135170.

At line:1 char:2
 +  create-react-app react-app
 +  ~~~~~~~~~~~~~~~~
     + CategoryInfo          : SecurityError: (:) [], PSSecurityException
     + FullyQualifiedErrorId : UnauthorizedAccess
Share Improve this question edited Mar 10, 2020 at 19:29 Codebling 11.4k3 gold badges44 silver badges70 bronze badges asked Mar 10, 2020 at 17:15 Bonnie NyamburaBonnie Nyambura 3413 silver badges6 bronze badges 1
  • 1 Does this answer your question? PowerShell says "execution of scripts is disabled on this system." – cbr Commented Mar 10, 2020 at 17:54
Add a ment  | 

1 Answer 1

Reset to default 6

Problem:

This error es when the PowerShell execution policy doesn’t allow us to run scripts. I also found the same error when tried to run a PowerShell script.

PowerShell - running scripts is disabled on this system

Solution:

If you do not have admin access, follow the below with mand => "Set-ExecutionPolicy -Scope CurrentUser".

The PowerShell execution policy is default set to Restricted. You can change the PowerShell execution policies with Set-ExecutionPolicy cmdlet. To run outside script set policy to RemoteSigned.

PS C:\> Set-ExecutionPolicy RemoteSigned 

Below is the list of four different execution policies in PowerShell

Restricted – No scripts can be run.

AllSigned – Only scripts signed by a trusted publisher can be run.

RemoteSigned – Downloaded scripts must be signed by a trusted publisher.

Unrestricted – All Windows PowerShell scripts can be run.

You Should Also Know:

You can use get the current set execution policy in PowerShell.

PS C:\> get-executionpolicy 

You can bypass this policy by adding -ExecutionPolicy ByPass when running PowerShell script.

c:\> powershell -ExecutionPolicy

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745349981a4623771.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信