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
1 Answer
Reset to default 6Problem:
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条)