It doesn’t look like there’s anything wrong with your JSON. However, the challenge you linked only asks for “author”, so perhaps you should try to delete everything besides that, and see if you pass the test.
{
"author": "Arslan",
}
Looking at the challenges after this one, you’ll see that you’ll add all of the other stuff later. (If this doesn’t work, try omitting the curly braces, as the example doesn’t use them on the challenge page.)
I’m having the same issue as mentioned in this post. Just started this section today and have the exact issue. Here’s my user agent in case it helps:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36.
I’ve also tried disabling AdBlockPlus and refreshing the window but this didnt change anything. In the Chrome Dev Tools Console I see these two errors:
jquery.js:3841 jQuery.Deferred exception: Unexpected token < in JSON at position 0 SyntaxError: Unexpected token < in JSON at position 0
at JSON.parse (<anonymous>)
at Object.eval (eval at _callee$ (https://www.freecodecamp.org/js/frame-runner.265bddf5f727538e7585.js:25:88133), <anonymous>:1:102)
at s (https://www.freecodecamp.org/js/frame-runner.265bddf5f727538e7585.js:25:25742)
at f (https://www.freecodecamp.org/js/frame-runner.265bddf5f727538e7585.js:25:26044) undefined
frame-runner.js:70 SyntaxError: Unexpected token < in JSON at position 0
at JSON.parse (<anonymous>)
at Object.eval (eval at _callee$ (VM263 frame-runner.265bddf5f727538e7585.js:25), <anonymous>:1:102)
at s (VM263 frame-runner.265bddf5f727538e7585.js:25)
at f (VM263 frame-runner.265bddf5f727538e7585.js:25)
Quick Update: This exact issue happens for the next few challenge: adding the description key, the keywords array as well. On the keywords challenge I see a new error where I clicked submit and then the UI showed the test output:
// running tests
package.json should have a valid "keywords" key (Test timed out)
"keywords" field should be an Array (Test timed out)
"keywords" should include "freecodecamp" (Test timed out)
// tests completed
Unless there is something happening on the backend test runners here, I’m out of ideas. I’m on a very fast and stable internet connection. Any help is appreciated.
FYI: I’m not a beginner but wanted to go through these challenges for fun/practice and while the other sections for javascript have been working fine for the past few months this section appears to be fairly broken for running the tests.
@brianfink Using your Glitch project url, I was able to pass the tests without issue for the Add Keywords to Your package.json challenge. What is the exact url you tried to submit?
Hi @RandellDawson, thanks for looking into this. I tried to submit using this url:
Trying again just now (after I saw your response) I’m still getting these errors:
// running tests
package.json should have a valid "author" key
// tests completed
I decided to try using a public github repo with the package.json I’ve been updating in the interim; same content. The online submission for the FCC challenges seems to have the same failure using that.
That is not the actual url that you can view. If you click the Show button at the top, you can Open the project in a New Window. The url which shows in the new window is working url for the project. The link you posted is for viewing/editing the project code.
That worked, thanks! I must have some how missed that the expected URL for the submission was where the front facing app could be viewed. Personally, that’s extremely confusing for a section dedicated entirely to a file like package.json.
I can confirm this is an ongoing issue; reporting not valid input when it is valid. Tried with Glitch, JSBin, Codepen and my own server. The pure text json of my most recent attempt is here. I tried in Chrome and Safari.
You can not just post a link to a json file. You have to incorporate into the project. You must clone the GitHub project specified to in the introduction section and update the package.json included with it. Then you must have a live working app that calls some code in the project to validate your package.json is correct.
I cloned the original GitHub project, loaded it to a personal repo on GitHub. After having updated the ‘package.json’ file, I copy/pasted this link : https://github.com/Braathen75/boilerplate-npm
Unfortunately, the test failed… And I don’t understand why. Could you help me with this ?
UPDATE: I finally passed the test using Glitch! Actually, it’s obvious: it was impossible to validate anything without using a platform… I’m really a rookie with Git and Glitch lol
The instructions on which URL to use really ought to be clearer in the lesson description… Glitch’s big ‘share’ button points to the project URL, not the live app URL, and the lesson doesn’t specify it needs to be the live URL.
This input field’s placeholder shows a codepen.io URL, so I tried that when the file’s raw Github URL failed.
Checking the console, what ever one pastes into the “Solution” input /_api/package.json will be appended. It seems that only Glitch works with the steps described by previous posters here, even though on the first page of the tutorial it says “Glitch” or “Github”.
As @Kohota107 already said, the URL required should be much clearer described.