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 npm Basics (retiring) Installing Packages with npm Installing Local Packages

Joseph Bertino
seal-mask
.a{fill-rule:evenodd;}techdegree
Joseph Bertino
Full Stack JavaScript Techdegree Student 14,652 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.

1 Answer

Joseph Bertino
seal-mask
.a{fill-rule:evenodd;}techdegree
Joseph Bertino
Full Stack JavaScript Techdegree Student 14,652 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!