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 Managing Dependencies in the package.json File

No dependencies in my package.json file.

When i created the package.json file, via

npm init

when i view my package file, I have all the information except the dependencies with the bcrypt version.

Anyone know why?

Whenever you run npm init it will create you a fresh copy of package.json and that includes having no dependencies or dev-dependencies. If you already had installed bcrypt and would like it in your package.json file just do as so:

npm i bcrypt --save

After that you can view your package.json file and you will see it has a section for dependencies.

3 Answers

Mike Constantino
Mike Constantino
12,034 Points

You always need to add the --save flag to save a package into your package.json. You can add this when your installing the package to your project.

10,572 Points

That didn't work for me uh.

Try deleting your node modules folder and npm install