npm Community Forum (Archive)

The npm community forum has been discontinued.

To discuss usage of npm, visit the GitHub Support Community.

I cant create a react app, its giving me errors

I cant create a react app, this is the error i am getting

Femis-MBP:~ femi$ npx create-react-app my-app

Creating a new React app in /Users/femi/my-app.

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

Unhandled rejection Error: EACCES: permission denied, open ‘/Users/femi/.npm/_cacache/index-v5/cb/f5/5167796b1df601b21f55bcc456b993154cc89759e4da4e7dabdc82aa83ad’

npm ERR! cb() never called!

npm ERR! This is an error with npm itself. Please report this error at:
npm ERR!

npm ERR! A complete log of this run can be found in:
npm ERR! /Users/femi/.npm/_logs/2019-07-24T12_43_54_335Z-debug.log

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

Deleting generated file… package.json
Deleting my-app / from /Users/femi
Femis-MBP:~ femi$

try sudo chown -R $USER /Users/femi/.npm and then rerunning create-react-app command
this can be related to a known bug in npm.

@isaacs is working on a fix for this

The fix is out! Release: 6.10.2

sudo npm i -g npm@latest
sudo chown -R $USER ~/.npm

and the problem should be gone for good.

God bless every one of you, its fine now. I was on that for more than 5hrs.