Bummer! You have been redirected as the page you requested could not be found.

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 Express Basics (2015) Getting Started with Express Your First Express App

package.json description left blank during init, but was populated when I opened it?!

erm anyone?

Is it because it was pre filled in via changes made to the master branch in git?

6 Answers

Hi Leon, do you have multiple branches? if so have you tried switching out to see if perhaps you saved it on a specific branch.

Did you push to master from any branch, aside from master?

just on master branch - the only one I have had open/checked out...

Try it for yourself:

  • clone/fork the repo
  • checkout master branch
  • npm init leaving all fields blank/default
  • open package.json and see that the description value is not blank

Confusing!

EDIT

Here is my npm init result.

As you can see, I left it blank, but it got filled in somehow!

/express-basics$ npm init
This utility will walk you through creating a package.json file.
It only covers the most common items, and tries to guess sensible defaults.

See `npm help json` for definitive documentation on these fields
and exactly what they do.

Use `npm install <pkg> --save` afterwards to install a package and
save it as a dependency in the package.json file.

Press ^C at any time to quit.
name: (express-basics) 
version: (1.0.0) 
description: 
entry point: (index.js) 
test command: 
git repository: (https://github.com/hdngr/treehouse-express-basics.git) 
keywords: 
author: 
license: (ISC) 
About to write to /home/leon/Desktop/express-basics/package.json:

{
  "name": "express-basics",
  "version": "1.0.0",
  "description": "This repo features an express app to serve as demo in the Express Basics course on Treehouse.",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "repository": {
    "type": "git",
    "url": "git+https://github.com/hdngr/treehouse-express-basics.git"
  },
  "author": "",
  "license": "ISC",
  "bugs": {
    "url": "https://github.com/hdngr/treehouse-express-basics/issues"
  },
  "homepage": "https://github.com/hdngr/treehouse-express-basics#readme"
}


Is this ok? (yes) 

when you cloned it, did it already have a package.json ? if so you could have override it when you ran npm init

Just to reiterate for clarity:

  • When the repo was cloned, there was no package.json.
  • npm init created the package.json
  • During the npm init, the description was intentionally left blank
  • When the package.json was opened, the description was filled in somehow.

Very confusing.

so it was this that caused confusion?

  "description": "This repo features an express app to serve as demo in the Express Basics course on Treehouse.",

yes - where did that come from?? I left that blank as per the video...