I'm getting error like this while creating react app
25,061
Solution 1
I think you are using Windows, I came across the same problem and it's because of a security feature in your system.
- Open powershell as an administrator.
- Run the following command
set-executionpolicy remotesigned
- Try again.
This worked for me.
Sources: https://www.faqforge.com/windows/windows-powershell-running-scripts-is-disabled-on-this-system/
Solution 2
Make sure you remove create-react-app
from npm
globally and use npx create-react-app {project_name}
to generate a react app.
npm uninstall --global create-react-app
npx create-react-app sample
also, make sure that your npm version is after 5.2 while doing these.
Solution 3
Run power shell as admin
- Windows Start
- Search for "Windows Powershell"
- Right click Windows Powershell
- Click Run as Administrator (Grant in "User Account Control" if shows up)
- Type
set-executionpolicy remotesigned
- Select/Type yes [Y]
Solution 4
try this command : npx create-react-app yourappname
Solution 5
- run cmd as adminstrator then
cd to the folder you want to create the app in it and type the following
create-react-app myapp
this worked for me
Author by
Admin
Updated on April 08, 2021Comments
-
Admin about 3 years
--> create-react-app : File C:\Users\ADMIN\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.com/fwlink/?LinkID=135170. At line:1 char:1 + create-react-app demo