António F. Aires
António F. Aires

Reputation: 51

Error "rollbackFailedOptional" on create-react-app

I'm learning React. I got this 2 errors in the screenshots below (links) when running:

npm i -g [email protected]

https://i.ibb.co/S7yszvz/Capture.png

https://i.ibb.co/4Y7LY6X/Capture2.png

What I tried:

I'm hoping for some help so I can make progress. Thanks

Upvotes: 1

Views: 4466

Answers (2)

Afrin Chakure
Afrin Chakure

Reputation: 51

I was facing similar issue a while back with npx create-react-app my-app as well. So I reinstalled NodeJs and then tried removing proxy set up from npm config by following commands:

  • npm init
  • npm config rm proxy
  • npm config rm https-proxy

and then try the command npm i -g [email protected] again.

Upvotes: 2

António F. Aires
António F. Aires

Reputation: 51

I finally did it using my phone network (must have been the firewall), but then:

C:\UserXXXX\Desktop\js REACT>create-react-app react-app

Creating a new React app in C:\UserXXXX\\Desktop\js REACT\react-app.

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

npm ERR! code ENOTFOUND
npm ERR! errno ENOTFOUND
npm ERR! network request to http://registry.npmjs.org/posix-character- 
classes/-/posix-character-classes-0.1.1.tgz failed, reason: getaddrinfo ENOTFOUND 
registry.npmjs.org registry.npmjs.org:80
npm ERR! network This is a problem related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly.  See: 'npm help config'

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\UserXXXX\AppData\Roaming\npm-cache\_logs\2018-12- 
11T10_28_30_314Z-debug.log

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

Deleting generated file... node_modules
Deleting generated file... package.json
Deleting react-app / from C:\UserXXXX\Desktop\js REACT
Done.

Upvotes: 3

Related Questions