I have the following error:
Unexpected token < in JSON at position 0
this is the json code,
“//1”: “describes your app and its dependencies”,
“//3”: “updating this file will download and update your packages”,
“author”: “Sammy Khaleel”,
“description”: “A simple Node app built on Express, instantly up and running.”,
“start”: “node server.js”
That error is not coming from this file.
So, from where? there is not enough info in this module to help me troubleshoot the problem.
This error is when JSON is expected, but HTML received.
You trying parsing JSON.parse(youvar) a not stringified object.in somewhere in your code.
I am not writing any code it is the first challenge in “managing packages with npm” module we were asked to write author name in package.json in a file hosted by glitch and then we should submit the link of glitch.
this is the link to the challenge:
Heya, your quotation marks are the wrong type, they shouldn’t be
“” they should be
Other than that, you also have a trailing comma near the end
package.json must be valid JSON
You should give a link to glitch project. click on share and tab code.
and there migth be < somewhere in this file you accidently type try ctrl+f and look for <
I think the problem is with my link, may be I should sign up for an account on glitch. but in the challenge there is no mention on that.
I still unable to solve the issue
I put the link to the actual app and the test is completed without the previous error but I still have an error that now I am unable to reproduce because glitch now prevent me from loading the app because I made too much requests (or that is my understanding).
Why this module is been abandoned when I tried to get a hint or ask for help I found this: This is a stub. Help our community expand it. any moderators here for the rescue?
Did you check your quotation marks?
I’ve provided the code above, you can see that it is a valid JSON.
your quotation marks are the wrong type, they shouldn’t be
“” they should be
Did you check that they’re the right type? As in not slanted quotation marks but instead the ASCII quotation mark
Copying your above code definitely doesn’t work due to that
This is the freecodecamp font that renders the double quote this way.
Can you post it within triple backticks so we can see it unformatted?
"//1": "describes your app and its dependencies",
"//3": "updating this file will download and update your packages",
"author": "Sammy Khaleel",
"description": "A simple Node app built on Express, instantly up and running.",
"start": "node server.js"
It’s really odd, but copypasting that works for me locally
I wonder if there’s a line-endings problem or something really daft like that, but that doesn’t seem likely if you’re editing in glitch directly
So I struggled with the same question for an hour or so until I went to the fcc project github link and saw how different the files are compared to the glitch project that popped up.
You need to start the project from this code. I did not want to do the whole clone and link it all to glitch so I just created the files and copied the contents into a glitch project. Lo and behold it works now.
Here’s my working glitch project: https://onyx-rake.glitch.me/
I hope it helps!
Make sure you are submitting the actual application URL and not the edit URL. When editing your project on Glitch, click Show Live at the top left, and submit that URL to FCC.
This is what worked for me. The “share” link that you see in the glitch editor doesn’t share your live project url it shares the link to edit your project on glitch