简体   繁体   中英

EACCESS Permission error while creating react app in Mac OS X

I'm getting the following warning while creating the react app, and after creating the project, I'm unable to add js file to the src folder I'm getting EACCESS in vscode

naseefali@NASEEFs-MacBook-Pro react % sudo create-react-app react-erp

Creating a new React app in /Users/naseefali/react/react-erp.

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

fsevents@1.2.13 install /Users/naseefali/react/react-erp/node_modules/watchpack-chokidar2/node_modules/fsevents node install.js

gyp ERR: configure error gyp ERR: stack Error, EACCES. permission denied. mkdir '/Users/naseefali/react/react-erp/node_modules/watchpack-chokidar2/node_modules/fsevents/build' gyp ERR. System Darwin 19.4.0 gyp ERR. command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" gyp ERR! cwd /Users/naseefali/react/react-erp/node_modules/watchpack-chokidar2/node_modules/fsevents gyp ERR! node -v v14.16.0 gyp ERR! node-gyp -v v5.1.0 gyp ERR! not ok

fsevents@1.2.13 install /Users/naseefali/react/react-erp/node_modules/webpack-dev-server/node_modules/fsevents node install.js

gyp ERR: configure error gyp ERR: stack Error, EACCES. permission denied. mkdir '/Users/naseefali/react/react-erp/node_modules/webpack-dev-server/node_modules/fsevents/build' gyp ERR. System Darwin 19.4.0 gyp ERR. command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" gyp ERR! cwd /Users/naseefali/react/react-erp/node_modules/webpack-dev-server/node_modules/fsevents gyp ERR! node -v v14.16.0 gyp ERR! node-gyp -v v5.1.0 gyp ERR! not ok

Are you just trying to run create-react-app ? You probably don't need the sudo no? If you have node installed, you can just run npx create-react-app my-app

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM