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

Where is package.json?

Hi,

The teacher is installing nodemon and then changing settings in the package.json. I do not have a package.json, only a package.lock in the same directory.

Should I create this package.json (I expected it to be created with npm init -y)? Or is it somewhere else outside of the flashcards folder (I'd expect not)?

1 Answer

Take a look at the docs: https://docs.npmjs.com/creating-a-package-json-file

It should be in the root of the project directory. Were you in the correct directory when you ran npm init -y ? What kind of output did you get when you ran the command?

Thanks for your reply ursaminor. I also expected it to be in the root of the project directory. I had no problems installing express, but when installing pug it started throwing errors so I thing something must have happened in between.

I solved it by creating a package.json file and type out everything I saw in the video and then run npm install again to be sure my project was on the versions mentioned in the package.json in the video.