Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

JavaScript npm Basics (retiring) Installing Packages with npm Installing Local Packages

Where can I get package.json for this tutorial?

When I install bcrypt there is only package-lock.json

I was asking for help for another question and the moderator mentioned I don't have the package.json file, but I don't recall it being provided and it didn't download for me on npm install

Thanks to anyone who can help!

2 Answers

Zack Lee
Zack Lee
Courses Plus Student 17,650 Points

Package.json is created when you initiate your npm modules. Just run

npm init

From the cli and it should build your package.json automatically.

Edward Pledger
Edward Pledger
2,757 Points

They should probably mention this in the tutorial for those of us that like to follow along on our own computer and not the provided Workspace. Was hoping somebody had asked this same question already.

word- completely sympathize as I also ran into this issue. I think it's safe to always begin your node packages with npm init and then install any additional package as you see fit.