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 trialGabbie Metheny
33,778 Pointsupdate: 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!
Alan McClenaghan
Full Stack JavaScript Techdegree Graduate 56,501 PointsNice one. I was getting permission errors with the global setup.
jlampstack
23,932 PointsYes - 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
Treehouse TeacherHi 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 :)
missfit
18,561 Pointsmissfit
18,561 PointsThanks! That helped me with my errors, I wish they would update the video with this information.