npx : File C:Program Filesnodejsnpx.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
- npx create-react-app .
-
+ CategoryInfo : SecurityError: (:) [], PSSecurityException + FullyQualifiedErrorId : UnauthorizedAccess
I encountered this error, Need to fix error
2
Answers
here's. I solve these problem using easy and quick steps
Type Set-ExecutionPolicy -Scope CurrentUser
Type RemoteSigned
Then Yes as Y type
then solved the error
This error occurs because PowerShell has restricted script execution for security reasons.
Steps to Fix:
Open PowerShell as Administrator
Check Current Execution Policy
Get-ExecutionPolicy
If it shows Restricted, you need to change it.
Set Execution Policy to Unrestricted
Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSigned
Verify the Change: run this cmd
enter code here
Retry the npx Command
npx create-react-app .