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 Components (2018) Build Modular Interfaces with Components Setting up with Create React App

npx create-react-app

I wish Guil showed us how he set up his file in https://teamtreehouse.com/library/setting-up-with-create-react-app-2. I wanted to continue working with my files from part 1 of this course. So I ran the command npx create-rreact-app <file name>. The terminal returned a file with this name already exists. So I figured that I need to run this command before I have created any files. So instead I downloded the files that come with the video. However the node_modules file was not included. To include node_modules i ran the command <npm install>. Again, nothing dowloaded. I tried running npm start, the terminal return the command doesn't exists. Here is what I have on my package.json "scripts": { "start": "react-scripts start",....}

I understand that you expect some files or pictures included. However, I didn't write any code to share updates with you. I downloaded the files from the video and tried to run couple command in the terminal without any luck.

Spencer Register
Spencer Register
10,184 Points

I wish he would have showed how to do the create react app part because I feel there would have been some value to starting from scratch. When I find an error in my console and I'm stuck, I will copy that from the terminal and search it on google. There is a lot of people that will have the same questions and answers and it helps understanding code to get other peoples examples. From what it sounds like is you might not have node installed.

1 Answer

J Tan
J Tan
11,847 Points

The node_modules directory/folder gets created when you run the npx create-react-app or when you run npm install command. It is derived from the package.json file which lists all the required packages to be installed into node_modules. npm start willl only work once you've installed all the packages from package.json file with the npm install command.