Ubuntu create-react-app fails with permission denied

前端 未结 6 2065
独厮守ぢ
独厮守ぢ 2021-02-08 12:32

I\'m getting a weird error:

Unhandled rejection Error: EACCES: permission denied, mkdir \'/home/ubuntu/.npm/_cacache/index-v5/14/36\'atus

I jus

6条回答
  •  傲寒
    傲寒 (楼主)
    2021-02-08 13:14

    This problem on a Mac

    Working from Reactjs's Getting Started documentation.

    The Environment

    • OSX Mojave 10.14.3
    • NodeJS v10.15.0

    The Error

    • Command
      npx create-react-app my-app
      
    • Output
      Unhandled rejection Error: EACCES: permission denied, mkdir '/Users/caseywise/.npm/_cacache/index-v5/ae/73'instal
      

    The Fix

    recursively change owner:group on caseywise's NPM preferences directory

    sudo chown -R caseywise:staff '/Users/caseywise/.npm/'
    

提交回复
热议问题