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

Katie Shook
Katie Shook
12,326 Points

error for installing npm in workspaces

I've tried adding the code from the teachers notes but Im still getting this error. I'm not sure if I am missing a step or if I have done something wrong. Any help is appreciated. Thanks.

treehouse:~/workspace$ npm install bcryptjs
npm WARN saveError ENOENT: no such file or directory, open '/home/tree house/workspace/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/home/treehou se/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.

  • bcryptjs@2.4.3
    updated 1 package and audited 437 packages in 2.434s
    found 0 vulnerabilities

1 Answer

Cody Wyatt
Cody Wyatt
13,365 Points

I created a new file "package.json" and set its contents to

{}

Once i install it updates the json to include the bcrypt as a dependency with the installed version. So after it installed bcrypt, my package.json file ended up becoming

{
  "dependencies": {
    "bcrypt": "^4.0.1"
  }
}

Also I refreshed the workspace directory to show the installed modules.