Skip to main content

--description--

Working on these challenges will involve you writing your code using one of the following methods:

  • Clone this GitHub repo and complete these challenges locally.
  • Use our Gitpod starter project to complete these challenges.
  • Use a site builder of your choice to complete the project. Be sure to incorporate all the files from our GitHub repo.

The package.json file is the center of any Node.js project or npm package. It stores information about your project. It consists of a single JSON object where information is stored in key-value pairs. There are only two required fields; name and version, but it’s good practice to provide additional information.

You can create the package.json file from the terminal using the npm init command. This will run a guided setup. Using npm init with the -y flag will generate the file without having it ask any questions, npm init -y.

If you look at the file tree of your project, you will find the package.json file on the top level of the tree. This is the file that you will be improving in the next couple of challenges.

One of the most common pieces of information in this file is the author field. It specifies who created the project, and can consist of a string or an object with contact or other details. An object is recommended for bigger projects, but a simple string like the following example will do for this project.

"author": "Jane Doe",

--instructions--

Add your name as the author of the project in the package.json file.

Note: Remember that you’re writing JSON, so all field names must use double-quotes (") and be separated with a comma (,).

If you are using Gitpod, make sure the app is running and the preview window is open. Copy the preview window's URL and paste it into the Solution Link input below.

--hints--

package.json should have a valid "author" key

(getUserInput) =>
$.get(getUserInput('url') + '/_api/package.json').then(
(data) => {
var packJson = JSON.parse(data);
assert(packJson.author, '"author" is missing');
},
(xhr) => {
throw new Error(xhr.responseText);
}
);