Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript Installing and Using Create React App

Gabbie Metheny
Gabbie Metheny
33,778 Points

update: use npx instead of installing globally

Looks like the current recommendation is to use npx rather than npm to avoid a global install. If you're just hearing of npx for the first time (I was!), here's a helpful overview from Kat MarchΓ‘n at npm. npx comes with npm 5.2+, and, essentially, it will install a temporary create-react-app and call it for you in a single step, without you needing to install it globally.

So where Guil does:

npm install -g create-react-app
cd desktop
create-react-app search-app

You can instead cd to the directory where you want to create your app, then do:

npx create-react-app search-app

You can then cd search-app and npm start just the same as Guil does in the video, everything else should look the same!

Thanks! That helped me with my errors, I wish they would update the video with this information.

Yes - I was wondering. I've seen others using npx as well. Guil Hernandez please comment. Perhaps course notes need an update?

For the record, mine words completely fine with npm. I am using Windows 10

1 Answer

Guil Hernandez
STAFF
Guil Hernandez
Treehouse Teacher

Hi jaycode,

There is an update on npx included in the teacher's notes of that video. I also use npx in the new "React Components" course: Setting up with Create React App :)