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

Katie Shook
Katie Shook
12,185 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
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.