Reputation: 341
-->
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
Upvotes: 34
Views: 54601
Reputation: 330
This error comes because Microsoft changed some PowerShell execution policies for your security.
We can create react app from mainly two places.
Hope it will work for you.
Upvotes: 3
Reputation: 21
if you're a Windows OS user open your Powershell and paste the following command on your PowerShell cmd -> set-executionpolicy remotesigned.
Upvotes: 1
Reputation: 39
Simply run Power shell as administrator then execute the command:set-executionpolicy remotesigned
Upvotes: 3
Reputation: 1897
Run power shell as admin
set-executionpolicy remotesigned
Upvotes: 16
Reputation: 5
Don't worry, I also got this error. This error comes when you try to write the command create-react-app
when you type the command npm install -g create-react-app, after running this command you should restart the command prompt or command powershell whatever you are using. After restarting command prompt now you can type create-react-app cmd.
Upvotes: 0
Reputation: 21
cd to the folder you want to create the app in it and type the following
this worked for me
Upvotes: 2
Reputation: 1078
I think you are using Windows, I came across the same problem and it's because of a security feature in your system.
set-executionpolicy remotesigned
This worked for me.
Sources: https://www.faqforge.com/windows/windows-powershell-running-scripts-is-disabled-on-this-system/
Upvotes: 66
Reputation: 26
Just stop your node server in "task manager", and start. After that try to install with npx or npm.
Hope it is useful.
Upvotes: 0
Reputation: 727
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.
Upvotes: 22