"'package.json' should have a valid 'author' key" -- But it does

First assignment in the “Managing Packages with NPM” course. I’m trying to complete the assignment to add an “author” tag to package.json in Replit. URL is package.json challenge - Replit

I’ve added my author tag to the given package.json code as shown below:

"name": "fcc-learn-npm-package-json",
  "author": "Robert Murrell",
	"dependencies": {
		"express": "^4.14.0"

This matches what I’m shown when I click “get a hint” for this assignment. However, when I try to submit the above URL, the test fails with the message that I don’t have a valid “author” key.

Running the code in Replit fails with this message:

Error: Cannot find module '/home/runner/packagejson-challenge/index.js'
Require stack:
- /nix/store/29fdcv1yhlll61ml8a31qdkrbprxd7gs-prybar-nodejs-0.0.0-67f7a00/prybar_assets/nodejs/module-context-hook.js
- /tmp/prybar-nodejs-4163776339.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:995:15)
    at Function.resolve (node:internal/modules/cjs/helpers:109:19)

Could that have something to do with it? Please help.

I do get the error about “index.js” missing. Unfortunately, the error persists even after I delete and re-import the template.

So I added a blank file named “index.js”. This resolves the issue on replit, but I still get the same error on freecodecamp when I try to submit my URL:

// running tests
package.json should have a valid "author" key 
// tests completed
 // console output [Error]

I actually wasn’t getting a preview window before; apparently I had to configure the npm run command before the preview window would appear.

Once I did, I saw the URL you were referring to. It still took a couple of tries, but I finally got my submission to pass. This issue is now resolved.

For anyone who finds this thread later, here’s a screenshot of what I saw in repl. The “preview window” appears in the upper right; the URL I needed to use to submit my work is highlighted in blue.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.