DEV Community

azeezgaa
azeezgaa

Posted on

Unable to create a React App

Hi,
I am new to this world. I install Node JS, from cmd when i type node -v i get v12.18.3 and npm -v i get 6.14.6

When i type npx create-react-app test

it starts loading but it stops in the middle as shown below but i am not getting happy hacking

Discussion (6)

Collapse
dhruvpatel profile image
Dhruv • Edited on

You need to install the react app generator i.e. npm i -g create-react-app. Once that goes through, the npx command should work.

Collapse
dv297 profile image
Daniel Vu

"npx" is a special feature of NPM 6 that allows the execution of packages without requiring you to first globally install the package.

See this example in the npx documentation
npmjs.com/package/npx#one-off-invo...

Collapse
azeezgaa profile image
azeezgaa Author

Hi Daniel,

I did install the npm globally as npm install create-react-app -g then when i try create-react-app my-app it is not working when i try npm create-react-app my-app it did installed but it stops in the middle

Collapse
samuelorobosa profile image
Samuel Amagbakhen

You can help us help you by showing us the error snippet

Collapse
azeezgaa profile image
azeezgaa Author

PS C:\myfirstapp> create-react-app myfirstapp
create-react-app : File C:\Users\MY PC\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 myfirstapp
  • ~~~~~~~~~~~~~~~~
    • CategoryInfo : SecurityError: (:) [], PSSecurityException
    • FullyQualifiedErrorId : UnauthorizedAccess PS C:\myfirstapp> ^C PS C:\myfirstapp>

Above is the error i am getting when i try to create a app without npx

Collapse
samuelorobosa profile image
Samuel Amagbakhen

Run the command prompt as admin and try again