Unhandled rejection Error, after install react with laravel

Hello, I want to install react with laravel, but when I start like that

php artisan preset react

npm i && npm run dev

I get this error

Unhandled rejection Error: EACCES: permission denied, open ‘/home/username/.npm/_cacache/index-v5/9a/10/33e796ac306baba1c40df7c2947f3f1bd4ab60dd95fc46163a5c5780e2cc’

Unhandled rejection Error: EACCES: permission denied, open ‘/home/username/.npm/_cacache/index-v5/04/69/81c52cf8ea1082f425d683b3fa9e736c296f2afd828ad0d0b3520a643720’

How I can fix it?

There were some problems where a past use of sudo with an npm install would leave behind a file with the wrong ownership. The quick fix is run this to fix the ownership, then try your install again:

sudo chown -R $USER ~/.npm

The most common problem was fixed in npm 6.10.2: Release: 6.10.2

1 Like

Thank you, everything good now.:+1:

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.