Jump to content

[SOLVED] Running "npx create-react-app' in Run Script


Recommended Posts

Posted

 I am trying to write an Alfred Workflow that creates a new react app. All the commands below are working fine EXCEPT for "npx create-react-app", anyone got this to work before?

 

Many thanks...

cd /Users/jameshusband/Development

mkdir {query}

cd {query}

npx create-react-app my-app

touch index.html

 

Posted

Sorry I failed to mention in OP that i have already tried pointing directly to the binary, Run Script looks like this:

cd /Users/theuser/development

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

 

Posted

I have managed to solve the issue by setting PATH variable. Found the Alfred Workflow Debug tool, very useful!!

 

cd /Users/jameshusband/development

PATH=/usr/local/bin npx create-react-app application

 

Posted

Ah, right. I guess npx calls other tools. Glad you got it working.

 

FWIW, you should generally use PATH=/usr/local/bin:$PATH so as not to remove directories and break things.

  • vitor changed the title to [SOLVED] Running "npx create-react-app' in Run Script

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...