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 trialDazeran Zamri
5,992 PointsError 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
Treehouse StaffHey 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 😃
Peter Harbour
226 PointsThis worked for me
Dazeran Zamri
5,992 PointsDazeran Zamri
5,992 PointsThis worked, thanks Rohald!
n r
7,665 Pointsn r
7,665 PointsHow do I actually change this?