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 Installing Packages with npm Installing Local Packages

Joseph Bertino
seal-mask
.a{fill-rule:evenodd;}techdegree
Joseph Bertino
Full Stack JavaScript Techdegree Student 13,943 Points

No such file '/home/treehouse/workspace/package.json'

I am unable to install bcrypt on Workspaces. Here is my attempt at running the command, and the resulting error:

treehouse:~/workspace$ npm install bcryptjs                                                                                                               
npm WARN saveError ENOENT: no such file or directory, open '/home/treehouse/workspace/package.json'                                                       
npm WARN enoent ENOENT: no such file or directory, open '/home/treehouse/workspace/package.json'                                                          
npm WARN workspace No description                                                                                                                         
npm WARN workspace No repository field.                                                                                                                   
npm WARN workspace No README data                                                                                                                         
npm WARN workspace No license field.
Joseph Bertino
seal-mask
.a{fill-rule:evenodd;}techdegree
Joseph Bertino
Full Stack JavaScript Techdegree Student 13,943 Points

Based on reading another very similar question, a solution (not explained in the video) is to first run npm init in the console, then hitting Enter through all the prompts to generate a packages.json file. After doing that, installing a module with npm worked for me!