Enable PowerShell Script Execution

 

✅ Solution: Enable PowerShell Script Execution

You can resolve this by temporarily or permanently changing the execution policy in PowerShell.


🔐 Option 1: Temporarily Allow Scripts (Recommended for most users)

Open PowerShell as Administrator, then run:

powershell
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass

Then run your npm command again, like:

powershell
npx create-react-app testapp25

🔓 Option 2: Permanently Allow Scripts (Use only if needed)

Open PowerShell as Administrator, then run:

powershell
Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSigned

Then try your command again.


🚨 Important Notes:

  • Always run PowerShell as Administrator to make changes to execution policy.

  • RemoteSigned means locally-created scripts can run, but downloaded ones need to be signed.

  • After changing execution policy, you can always revert it:

powershell
Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy Restricted

Let me know if you want to switch to Git Bash or Command Prompt (cmd) instead — they usually don’t have this issue.

Previous
Next Post »