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 React Basics First Steps in React Setting Up a React App

Dazeran Zamri
Dazeran Zamri
5,992 Points

Error when running command in terminal

Hi, was trying to follow along the video but got stuck at running the command "npm i"

Error as follows :

dazeranzamri@Dashs-MacBook-Pro react-basics % npm i npm ERR! code ENOENT npm ERR! syscall open npm ERR! path /Users/dazeranzamri/Documents/Education/react-basics/package.json npm ERR! errno -2 npm ERR! enoent ENOENT: no such file or directory, open '/Users/dazeranzamri/Documents/Education/react-basics/package.json' npm ERR! enoent This is related to npm not being able to find a file. npm ERR! enoent

npm ERR! A complete log of this run can be found in: /Users/dazeranzamri/.npm/_logs/2023-09-27T21_19_49_999Z-debug-0.log dazeranzamri@Dashs-MacBook-Pro react-basics %

2 Answers

Rohald van Merode
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Rohald van Merode
Treehouse Staff

Hey Dazeran Zamri 👋

Looks like you're in the wrong directory when running the command. You'll want to make sure to change into the directory where the project files are located.

Judging from the error snippet you've shared it looks like you're located in the /react-basics folder but you'll want to move into the grocery-list directory. This is where the package.json file is located that is required to run the install command.

Hope this will help to get you going again 😃

Dazeran Zamri
Dazeran Zamri
5,992 Points

This worked, thanks Rohald!

n r
n r
7,513 Points

How do I actually change this?

Peter Harbour
Peter Harbour
226 Points

This worked for me