Managing Packages with Npm - Expand Your Project with External Packages from npm

I have been stuck on this challenge:https://learn.freecodecamp.org/apis-and-microservices/managing-packages-with-npm/expand-your-project-with-external-packages-from-npm

Here is what I have tried:https://glitch.com/edit/#!/arjun-taneja

Pls help

:pensive:

{
  "author": "Arjun Taneja",
  "version": "1.0.0",
  "name": "fcc-learn-npm-package-json",
  "description": "A project that does something awesome",
  "keywords": [ "freecodecamp", "learning", "loop" ],
  "dependencies": {
    "package-name": "version",
   "express": "2.14.0",
    "moment": "2.14.0",
  },
  "main": "server.js",
  "scripts": {
    "start": "node server.js"
  },
  "engines": {
    "node": "8.11.2"
  },
  "repository": {
    "type": "git",
    "url": "https://idontknow/todo.git"
  },
  "license": "MIT"
}

You need to separate each key/value pair with a comma, see if that fixes it.

1 Like

do i have to copy the app or the code?
it doesnt work with either

You canā€™t have a comma in the last element in your package.json file:

"dependencies": {
  "package-name": "version",
  "express": "2.14.0",
  "moment": "2.14.0",
},

Remove the comma after the moment dependency.

1 Like

I just did what asked to me to do and the same thing happened.

:sob:

Pls help

:tired_face:

There should be a comma after each key-value pair except for the last ones.

{
  "author": "Arjun Taneja",
  "version": "1.0.0",
  "name": "fcc-learn-npm-package-json",
  "description": "A project that does something awesome",
  "keywords": [ "freecodecamp", "learning", "loop" ] //comma here
  "dependencies": {
    "package-name": "version",
   "express": "2.14.0",
    "moment": "2.14.0"
  },
  "main": "server.js",
  "scripts": {
    "start": "node server.js"
  },
  "engines": {
    "node": "8.11.2"
  },
  "repository": {
    "type": "git",
    "url": "https://idontknow/todo.git"
  },
  "license": "MIT"
}
1 Like

It still does not work.

https://arjun-taneja.glitch.me

:disappointed:

Can I see your error?

Itā€™s ok. I found the problem.
You have ā€œpackage-nameā€: ā€œversionā€ in your dependencies right?
It shouldnā€™t be there. Remove it. That is just the format to include external packages.

1 Like

it still doesnt work

I see what is wrong now. You are required to include moment with a version number of 2.14.0 and express with version of 4.14.0. Try that and do not linebreak.

{
  "author": "Arjun Taneja",
  "version": "1.0.0",
  "name": "fcc-learn-npm-package-json",
  "description": "A project that does something awesome",
  "keywords": [ "freecodecamp", "learning", "loop" ],
  "dependencies": {
    //no linebreak
   "express": "2.14.0",//change to 4.14.0
    "moment": "2.14.0"
  },
  "main": "server.js",
  "scripts": {
    "start": "node server.js"
  },
  "engines": {
    "node": "8.11.2"
  },
  "repository": {
    "type": "git",
    "url": "https://idontknow/todo.git"
  },
  "license": "MIT"
}
2 Likes

THAAANK YOUUUUUU

:pray:t2:

No worries. It was just a minor mistake. It will all seem a bit confusing in the beginning, but then youā€™ll come to realise that it is very easy.

1 Like