0

I tried npx create-react-app my-app and here's the error: (ps: I tried npm init npm install create-react-app and then the cmd showed above. got the same err) HELP!

Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template...
npm ERR! code 1
npm ERR! path /Users/atomxv/Desktop/my-app/node_modules/canvas
npm ERR! command failed
npm ERR! command sh -c node-gyp rebuild
npm ERR! SOLINK_MODULE(target) Release/canvas-postbuild.node
npm ERR!   CXX(target) Release/obj.target/canvas/src/backend/Backend.o
npm ERR!   CXX(target) Release/obj.target/canvas/src/backend/ImageBackend.o
npm ERR!   CXX(target) Release/obj.target/canvas/src/backend/PdfBackend.o
npm ERR! ../src/backend/Backend.cc:111:10: warning: address of stack memory associated with local variable 'msg' returned [-Wreturn-stack-address]
npm ERR!   return msg.c_str();
npm ERR!          ^~~
npm ERR! 1 warning generated.

AtomXV
  • 11
  • 1
  • https://github.com/Automattic/node-canvas/issues/528#issuecomment-75594557 In your case replace "npm install canvas" to "npx create-react-app my-app" – Mihályi Zoltán Dec 29 '20 at 16:42

1 Answers1

0

You’ll need to have Node >= 10 on your local development machine. Also you dont have to do npm init npm install create-react-app

ibsenv
  • 619
  • 1
  • 5
  • 18