Semantic versioning challenge NPM

I am getting many error messages on the console when I enter in the code to pass the test. Is there s glitch with repl.it which what i am using to complete the NPM challenges I am changing the version of "moment " Below is my code :

{
	"name": "fcc-learn-npm-package-json",
	"dependencies": {
		"express": "^4.14.0"
    "moment": "2.10.2"

	},
	"main": "server.js",
	"scripts": {
		"start": "node server.js"
	},
	"engines": {
		"node": "8.11.2"
	},
	"repository": {
		"type": "git",
		"url": "https://idontknow/todo.git"
	}
}

Hello there,

I’ve edited your post for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (’).


Now, you can see the formatted code is showing the syntax highlighting for your JSON. Notice how there is an inconsistency in the highlighting? This indicates a syntax error, which the console should describe with an error.

For future reference, it would be helpful, if you provide the link to your project code, and, potentially, the error message you are seeing.

Cheers

You are missing a comment in between one of your dependencies.

in between where am i missing the comment “moment” and "express?

Yes, comma missing there. Without the comma, it’s not valid JSON, so it’ll error.

I put the missing the comma and all i got was a bunch of errors

thats the messages I get even with inserting the comma

Nothing I am doing is working. Is there a reason?

When I pull your project up and click Run, I see an error in the Node console on the right side. The error is: Error: Cannot find module 'express'. For some reason repl.it does not appear to be automatically installing the packages referenced in package.json. You can manually run the install by typing npm install. This should get rid of the errors you are seeing.

I can type npm install into the code editor on repl.it? I am asking to make sure that I am understanding correctly?

I manually typed in nmp install and still get the same errror messages

You typed npm install inside package.json. Remove that. You should be typing it only in the console on the right side.

still isn’t working i have no idea what the problem is…

What are the errors?

typed npm install manually on the console and it seems to want to work but then nope it keeps on giving me the errors on the right side. i typed in “moment”: “2.10.2” in the dependencies and nothing seems to work . I am seriously considering giving up i can’t do it

So try this in the console:

npm install

let it do its thing (which could take a little time) and the type:

npm start

and see what happens. I forked your project and did these two things and it works as it should. If it continues to be a problem, I would re clone the project from the boilerplate repo and start again at the first lesson.

FYI - The challenge you were on expects you to use a different version of moment than you were specifying (though that is not the cause of the error you are seeing in the console).

Did that nothing happens

Did you try re-cloning the project? When I clone the project from scratch, I experience no issues at all.

1 Like

Yes I recloned it and it worked