Managing Packages with NPM - How to Use package.json, the Core of Any Node.js Project or npm Package

Tell us what’s happening:
Stuck in the first back end challenge, using replit. All I need to do is add the “author”:“my name” key to the package.json. I’ve done that (and I’ve even tried copy/pasting the given solution).

Based on something I saw in the forum, I ran the code in replit and I’ve tried pasting in the url from the replit browser over the pane where the results display. I’ve also tried pasting in the link to the repl itself, but neither passes the test.
Your project link(s)

Link to repl: boilerplate-npm - Replit

solution: boilerplate-npm - Replit

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36

Challenge: Managing Packages with NPM - How to Use package.json, the Core of Any Node.js Project or npm Package

Link to the challenge:

What url are you submitting for the challenge? It should be the one that shows in the preview window once you click Run.

Yes, that is the url I submitted-it is the one from the preview window:
https://boilerplate-npm.johnshelb.repl.co

The link to the code is:

Once you click Run, you should see a preview window. I do not see that in your screenshot.

Actually, it appears as if your replit is corrupt. I would start over with a replit using the starter link in the challenge.

I didn’t take a screenshot, that just appeared when I pasted in the url for the code. But when I click on Run in the screenshot, the preview window does appear:

Manage Node.js projects and npm packages using package.json

Part 1 of Free Code Camp Backend Challenges

Oh, I just saw the second part of your message. Okay, I’ll start over with a new replit.

I started over:

  1. clicked on the starter link

  2. When the repl loaded, I chose “use run command” and clicked “Done”

  3. I changed the package.json file so it looks like this:
    {
    “name”: “fcc-learn-npm-package-json”,
    “author”:“Jane Doe”,
    “dependencies”: {
    “express”: “^4.14.0”
    },
    “main”: “server.js”,
    “scripts”: {
    “start”: “node server.js”
    },
    “repository”: {
    “type”: “git”,
    “url”: “https://idontknow/todo.git
    }
    }

  4. I clicked Run. The webview pane showed:

Manage Node.js projects and npm packages using package.json

Part 1 of Free Code Camp Backend Challenges

  1. I copied the url from above that preview window
  2. I pasted the url into the solution link input
  3. This is the result:
    // running tests
package.json

should have a valid “author” key // tests completed // console output [Error]

Tests

  • Failed:package.json should have a valid “author” key

Any idea why this is failing?

It’s the same Replit issue others face. Use this URL instead (-- instead of . in front of the user name).

https://boilerplate-npm--johnshelb.repl.co

2 Likes

Thank you so much, lasjorg! It’s so frustrating to be stuck at the very beginning like that. I very much appreciate the rescue!