Can't create react app

What I Wanted to Do

I wanted to create new React App

What Happened Instead

I receive error message about npm bug.

Reproduction Steps

  1. Prompt create-react-app mis in your terminal.

Details

Creating a new React app in /home/mikhail/WebstormProjects/mis.

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

Unhandled rejection Error: EACCES: permission denied, open '/home/mikhail/.npm/_cacache/tmp/02c41182'

Unhandled rejection Error: EACCES: permission denied, open '/home/mikhail/.npm/_cacache/tmp/1c15acea'

Unhandled rejection Error: EACCES: permission denied, open '/home/mikhail/.npm/_cacache/tmp/73553dbf'

npm ERR! cb() never called!

npm ERR! This is an error with npm itself. Please report this error at:
npm ERR!     <https://npm.community>

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/mikhail/.npm/_logs/2019-04-28T19_04_02_152Z-debug.log
<!-- What did you actually try to do? What were you expecting would happen? -->
<!-- give specific instructions for how someone else can reproduce this behavior if possible. A gist or git repository that can be `npm install`-ed to reproduce an issue is often super helpful! -->

2019-04-28T19_04_02_152Z-debug.log (656 Bytes)

Platform Info

$ npm --versions
{ npm: '6.9.0',
  ares: '1.14.0',
  cldr: '32.0.1',
  http_parser: '2.7.1',
  icu: '60.2',
  modules: '57',
  nghttp2: '1.30.0',
  node: '8.10.0',
  openssl: '1.0.2n',
  tz: '2017c',
  unicode: '10.0',
  uv: '1.18.0',
  v8: '6.2.414.50',
  zlib: '1.2.11' }

$ node -p process.platform
linux

Ubuntu version: 18.04.2 LTS (Bionic Beaver)
Kernel: Linux 4.13.0-39-generic

PS: it is work, if I prompt command with sudo prefix

Thanks. There is an open issue with installing global packages using sudo leaving behind files with the wrong ownership.

The short version is run this to fix the ownership, then try your install again:


sudo chown -R $(whoami) ~/.npm

The long version and canonical bug is: Global installs (sudo npm i -g) fail on Mac after 6.5 upgrade. Works fine after 6.4.1 downgrade.

1 Like

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