I
I
IcEWaRRiOr2021-06-01 08:38:51
React
IcEWaRRiOr, 2021-06-01 08:38:51

Trouble installing React for the first time?

Hello, I'm starting to learn React, and I ran into a problem installing it. The problem is this: when I enter the command

npx create-react-app my-app

, the following happens: a very long download starts, then it gives the following:

Creating a new React app in /home/sasha/my_project/react/my-app.

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

npm ERR! code FETCH_ERROR
npm ERR! errno FETCH_ERROR
npm ERR! invalid json response body at https://registry.npmjs.org/@rollup%2fplugin-replace reason: Unexpected end of JSON input

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/sasha/.npm/_logs/2021-06-01T05_16_28_507Z-debug.log

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

Deleting generated file... package.json
Deleting my-app/ from /home/sasha/my_project/react
Done.


When I enter through sudo:

sudo npx create-react-app my-app

it immediately gives out:

sh: 1: create-react-app: Permission denied

What to do? Help me please

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vasily Bannikov, 2021-06-01
@vabka

sudo npx create-react-app my-app

Can't with sudo
npm ERR! code FETCH_ERROR
npm ERR! errno FETCH_ERROR
npm ERR! invalid json response body at https://registry.npmjs.org/@rollup%2fplugin-replace reason: Unexpected end of JSON input
npm ERR! A complete log of this run can be found in:
npm ERR! /home/sasha/.npm/_logs/2021-06-01T05_16_28_507Z-debug.log

Apparently something with the network, since such an error. Try visiting https://registry.npmjs.org/@rollup%2fplugin-replace yourself and see the logs

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question