Can't install 'http' as a dependency

Tell us what’s happening:
Never had a problem installing packages/adding dependencies until now. Am I missing something? I keep getting the following error in the console on repl.it when adding the ‘http’ dependency…

Console log error:
No matching version found for http@^0.12.2
In most cases you or one of your dependencies are requesting
a package version that doesn’t exist.
Repl.it: Package operation failed.

**Your code so far** - package.json
{
  "//1": "describes your app and its dependencies",
  "//2": "https://docs.npmjs.com/files/package.json",
  "//3": "updating this file will download and update your packages",
  "name": "fcc-advanced-node-and-express",
  "author": "http://github.com/JosephLivengood",
  "version": "0.0.1",
  "description": "What am I about?",
  "main": "server.js",
  "scripts": {
    "start": "node server.js",
    "dev": "nodemon server.js"
  },
  "dependencies": {
    "dotenv": "^8.2.0",
    "express": "^4.16.1",
    "mongodb": "^3.6.3",
    "node": "12.18.0",
    "pug": "3.0.0",
    "passport": "^0.3.2",
    "passport-local": "1.0.0",
    "bcrypt": "5.0.0",
    "passport-github": "1.1.0",
    "http": "^0.12.2",
    "socket.io": "3.1.1",
    "express-session": "^1.15.0"
  },
  "repository": {
    "type": "git",
    "url": "https://glitch.com/#!/project/welcome-project"
  },
  "keywords": [
    "node",
    "express",
    "pug",
    "passport",
    "socketio"
  ],
  "license": "MIT",
  "devDependencies": {
    "nodemon": "^2.0.4"
  }
}

Note: I have tried other versions and also Googling solutions and nothing works. Please advise… Thank you!

Couldn’t copy and paste the direct url to my project because the package fails to load right now. But hopefully the info I provided is enough to help with a solution. Thank again!

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.104 Safari/537.36.

Challenge: Set up the Environment

Link to the challenge:

1 Like

Hi @jjmason ,
As per my understanding, Node.JS comes with http module. It doesn’t have to be installed separately as a dependency. It can be included by using require('http') in the file where it is needed.
https://nodejs.dev/learn/the-nodejs-http-module

2 Likes

@Sunithack1 Thank you! The course said to add it as a dependency so that threw me off. Thanks for your response, it worked.