Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

create-react-app, installation error ("command not found")

I have installed create-react-app exactly as instructed on the facebook instruction page (https://facebook.github.io/react/blog/2016/07/22/create-apps-with-no-configuration.html):

First, install the global package:

npm install -g create-react-app

I did this. It appeared to work fine - the file was installed to

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

I'm not really sure why global install takes it to this path, but there you have it.

Next instruction:

Now you can use it to create a new app:

create-react-app hello-world

Couldn't be simpler, right? But Terminal spits out this at me:

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

It's probably something very simple I'm missing but I don't really know where to look. If anyone can help I'd really appreciate it!

Thanks in advance.

Note: I'm using Node v6.3.1, and npm v3.10.3

like image 799
Paulos3000 Avatar asked Aug 03 '16 19:08

Paulos3000


People also ask

Which command is used to install create-react-app?

To install the full React toolchain on WSL, we recommend using create-react-app: Open a terminal(Windows Command Prompt or PowerShell). Create a new project folder: mkdir ReactProjects and enter that directory: cd ReactProjects . npx is the package runner used by npm to execute packages in place of a global install.

Why react app is not creating?

If you really need create-react-app , you might need to reinstall Node and reconfigure your dependencies to ensure you have a fresh start with Node, npm, npx, and the like.

How do you fix sh react scripts command not found?

Run the npm install react-scripts command to solve the "react-scripts: command not found" error. If necessary delete your node_modules directory and your package-lock. json file, reinstall your dependencies and restart your development server.


1 Answers

You are able to apply the following solution:

$ npm config set prefix /usr/local $ sudo npm install -g create-react-app $ create-react-app my-app 
like image 193
Hamdi Bayhan Avatar answered Oct 05 '22 21:10

Hamdi Bayhan