Mcbriandavids
Mcbriandavids

Reputation: 41

How can i correct the error i keep getting in creating a react app

Each time i tried creating a react app using create-react-app <...name> i keep getting this error " Creating a new React app in C:\windows\system32\brian-todos.

Installing packages. This might take a couple of minutes. Installing react, react-dom, and react-scripts...

npm ERR! Unexpected end of JSON input while parsing near '...tXcMskoaoOolrubJ3NQGh'

npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\BrianMartinez\AppData\Roaming\npm-cache_logs\2019-01-12T13_11_25_580Z-debug.log

Aborting installation. npm install --save --save-exact --loglevel error react react-dom react-scripts has failed.

Deleting generated file... package.json Deleting brian-todos / from C:\windows\system32 Done."

I even tried npm clear cache it still didn't not work.What do i do about this challenge

Upvotes: 0

Views: 379

Answers (2)

Mcbriandavids
Mcbriandavids

Reputation: 41

This is the answer to the challenge i had before now. follow these steps

  1. npm install -g yarn

  2. yarn global add create-react-app

  3. create-react-app

Upvotes: 0

Oscar Calderon
Oscar Calderon

Reputation: 989

It seems you opened your windows console or powershell as an administrator, and you landed in system32 folder. Don't create your project there, that is a reserved folder for system executables. Do something like cd C:\Users\yourusername\Documents and try there.

Upvotes: 1

Related Questions