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!

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 React Basics (2018) Thinking in Components Use a Component with JSX

Initializing app in browser

Hello all, I took a hiatus from this course and have been doing other things with create-react-app. Now I can't figure out how to get this app to host locally (my go to npm install and npm start don't work). Any help would be greatly appreciated. Thank you!

Go you have npm installed globally? Are their error messages? Are you talking about a specific course video or one of your projects?

Link: Create React App

npx create-react-app my-app
cd my-app
npm start

npm is installed globally. My error messages can be found here https://pastebin.com/5nCnigW8 . The module I was working on is https://teamtreehouse.com/library/use-a-component-with-jsx Should I just create-react-app a starting point and paste files into it? Thanks again!

1 Answer

It looks like in that section they haven't started using node but instead using a simple http server and CDNs.

<script crossorigin src="https://unpkg.com/react@16/umd/react.development.js"></script>
    <script crossorigin src="https://unpkg.com/react-dom@16/umd/react-dom.development.js"></script>
    <script src="https://unpkg.com/babel-standalone@6/babel.min.js"></script>
    <script type="text/babel" src="./app.js"></script>

Here is the link they provide for the HTTP Server

You could try creating the react app and load the source files, or just follow along using a simple webserver. I think I was using my XAMPP server for that section.

Colin Rhoads
Colin Rhoads
772 Points

Its insane that you can't have a straight forward setup video going into this lesson. Pay too much money for these courses to spend the entire evening trying to figure out how to get these files to run locally.