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 trialFernando Boza
25,384 PointsNo 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?
3 Answers
Mike Constantino
12,034 PointsYou 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.
Fernando Boza
25,384 PointsThanks Mike Constantino and Anthony Pileggi
fredyrosales
10,572 PointsThat didn't work for me uh.
Fernando Boza
25,384 PointsTry deleting your node modules folder and npm install
Anthony Pileggi
544 PointsAnthony Pileggi
544 PointsWhenever 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.