Create-response-app, installation error ("command not found")

I installed the create-response-app in the same way as indicated on the facebook instructions page ( https://facebook.imtqy.com/react/blog/2016/07/22/create-apps-with-no-configuration. html ):

First install the global package:

npm install -g create-react-app

I have done it. It worked fine - the file was installed on

 users/*name*/.node_modules_global/lib/node_modules/create-react-app 

I'm not sure why the global installation takes it this way, but there you have it.

The following instruction:

Now you can use it to create a new application:

create-react-app hello-world

It couldn't be easier, right? But Terminal spits it out of me:

 -bash: create-react-app: command not found 

Maybe something is very simple, but I don’t know where to look. If anyone can help, I would really appreciate it!

Thanks in advance.

Note. I am using Node v6.3.1 and npm v3.10.3

+20
source share
7 answers

Your Node setting looks incorrect. This is not a problem with the Create React App - it seems that you cannot run any global Node commands.

It looks like ~/.node_modules_global/bin not in the PATH environment variable, so it cannot execute global commands. This is how Bash works - it cannot guess where the team is, you need to say so. I would suggest that installing Node should do this by default, but it depends on how you installed Node.

So make sure the directory is in your PATH and try again. If you are using Bash, add this to your .profile and restart the terminal:

 export PATH=$HOME/.node_modules_global/bin:$PATH 
+18
source

You can apply the following solution:

 $ npm config set prefix /usr/local $ sudo npm install -g create-react-app $ create-react-app my-app 
+31
source

Environment variables are set incorrectly. When you run the create-react-app it shows the path along with the error. Copy this path and add it to the environment variable.

Alternatively, you can use the command:

 npx create-react-app <app_name>. 

This will do the job for you.

+9
source

Try this. It worked or for me. I found this in the React documentation. "Npx" is not a typo. This is a package launch tool that comes with npm 5.2+.

npx create-respond-application my-application

+3
source

I have the same problem and this solution did not work for me. I have:

export PATH=$HOME/.node_modules_global/bin:$PATH

in .bash_profile

Currently echo $ PATH shows:

/Users/username/.node_modules_global/bin:/Users/username/.rvm/gems/ruby-2.1.6/bin:/Users/username/.rvm/gems/ ruby-2.1.6@global /bin:/Users/username/.rvm/rubies/ruby-2.1.6/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/username/.rvm/bin

If I move to Home, I will see .npm and .npm-global. There is an alias for creating-reaction-application in .npm-global / bin / and a folder in

.npm-global/lib/node_modules/create-react-app

0
source

The answers given above are correct, but I want to share what I also encounter, and these are the basics ================ To configure to respond to the project ======= =======================

If you want to create a host environment

 $ sudo apt-get update $ sudo apt-get install nodejs 

(sometimes we can use, but sudo menas are installed at the system level $ apt -g et nodeenv)

 $ sudo apt-get install nodeenv $ nodeenv env $ source /bin/activate 

If you want to respond with the new Reaction app, then

 $ npm install create-react-app 

if an create-react-application error occurs: the command was not found, then install with -g, this is because the node is installed globally, and it doesn’t

get the node in local

 $ npm install -g create-react-app $ create-react-app app_name $ cd app_name app_name$ npm start 
0
source

I hope you already installed Node Package Manager (npm). Now run npm install -g create-react-app , if all is well, you can use create-ract-app . if you get any permission error just sudo npm install -g create-react-app .

I hope this works. Happy hacking.

0
source

All Articles