0

I am trying to create a bash script that runs npx create-react-app my-app.

My Current Script:

cd /Users/theuser/Development

/usr/local/bin/npx create-react-app my-app

I have tried simply calling npx command and also pointing directly to binary but when the script is executed (from an Alfred Workflow) I do not see a React App created.

If I run the /usr/local/bin/npx create-react-app my-app from terminal then I do see the React App Created.

James
  • 281
  • 3
  • 9
  • Please edit the following information in your question to improve it : 1) what does "create react app does not work" mean? Any error message, or just no output at all? 2) Have you previously tried to run `npx create-react-app my-app` in your shell, in which context, how did it go? 3) please include how you try to run the script – Aaron Feb 05 '20 at 10:06
  • Apologies, I expected this comment :) – James Feb 05 '20 at 10:42

1 Answers1

1

I found that temporarily setting the PATH fixed the issue, attaching a debugger to my script execution showed that node could not be found...

PATH=/usr/local/bin npx create-react-app application
James
  • 281
  • 3
  • 9