How to submit a solution for the back end tutorial

Tell us what’s happening:
I am trying to submit solution for https___www.freecodecamp.org/learn/back-end-development-and-apis/managing-packages-with-npm/how-to-use-package-json-the-core-of-any-node-js-project-or-npm-package

I have read the instructions, cloned the boilerplate repo from https___ GitHub - freeCodeCamp/boilerplate-npm: A boilerplate for the freeCodeCamp curriculum.

I have made the change to add an “author” property in the package.json file. I have committed and pushed the change to my repo at https___github.com/spamfro/fcc-back-end/blob/gomix/package.json

I have run the local server, and checked it’s operational at http___local host:3000

I tried to “submit” the following links in the “Solution link” edit on the tutorial page at https___www.freecodecamp.org/learn/back-end-development-and-apis/managing-packages-with-npm/how-to-use-package-json-the-core-of-any-node-js-project-or-npm-package

The live site (with or without the trailing forward slash):
http___localhost:3000/

Notice that I can correctly load the package.json through the “hidden” _api link:
http___localhost:3000/_api/package.json

My GitHub repo HTTP link:
https___github.com/freeCodeCamp/boilerplate-npm.git

My GitHub repo SSH link (…this is not even accepted as it is not an http link):
git@github.com:freeCodeCamp/boilerplate-npm.git

Direct link to the local directory through http-server file server:
Http___local host:3000/

Neither of these works - the page shows the tests fail.

I tried another tutorial with the same result- https___www.freecodecamp.org/learn/back-end-development-and-apis/basic-node-and-express/meet-the-node-console

I’ve searched for solutions in freeCodeCamp forums, in Stackoverflow, … nothing works.

Either instructions are incomplete or am I missing something?

Thanks,
George

PS: the forum does not allow more than two links so I had to edit them to go through.

Your project link(s)

solution: GitHub - spamfro/fcc-back-end

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.5 Safari/605.1.15

Challenge: How to Use package.json, the Core of Any Node.js Project or npm Package

Link to the challenge:

Neither of these are your repo. Those are freeCodeCamp’s.

EDIT: I pulled down your repo, installed the packages, started the server, and entered http://localhost:3000/ for the url to submit and passed the first challenge in that section.

If you are trying to run these locally, you will need to make sure to first run:

npm install

within the folder containing the project files.

Then, after you make your changes, to start the server, you will need to run:

npm start

This will start the server and allow you to access http://localhost:3000/ from your browser. Each time you make a change something in the package.json file, you will need to stop and restart the server. You may need to run npm install again, so the latest package.json file is used by the project.

Most people use the repl.it version since it is easier to re-run the server when needed.

1 Like

My mistake - the git repo links to my repo was a typo.

I did npm install and npm start, and the site was operational on http localhost 3000 (…including the _api interface to package.json).

However if I put the very same link http://localhost:3000/ in the “solution link” edit and press ENTER, the page shows that the tests were run, but the package was still expected to have a valid “author” key (aka tests failed)

Now that you said it worked as expected when you tried it on you machine I thought it might have been the weird setup I am using (a Linux forwarding a port on my iPad) even though it shouldn’t, … I tried it on my MacBook on Safari and had the same result - the site runs, the page won’t pass he tests.

Since you confirm that my code works in your setup, I can only assume it’s probably not the code… I just tried it in Chrome and it worked with no issues.

So Safari (both iOS and macOS) fails to execute the tests, Chrome on macOS seems to work, Chrome on iOS does not.

Thanks for the support,
George

Safari does not work well in general with the curriculum here.

I verified that the issue with Safari (both macOS and iOS) is that they require a VALID https link - a local http://localhost:3000/ won’t work, however a small change in the server.js boilerplate to run on https with a valid certificate forks fine. I guess Safari is more restrictive when it comes to calling http origin (the test target) form an https site script (the test driver).

I hope this helps. I actually learned a lot digging into this.