Problem when trying to deploy my app on heroku

Tell us what’s happening:
Describe your issue in detail here.
I’m trying to depoy my app to heroku but i’m getting the following error :

    npm ERR! Error while executing:

   npm ERR! /usr/bin/git ls-remote -h -t ssh://

   npm ERR! 

   npm ERR! Host key verification failed.

   npm ERR! fatal: Could not read from remote repository.

   npm ERR! 

   npm ERR! Please make sure you have the correct access rights

   npm ERR! and the repository exists.

   npm ERR! 

   npm ERR! exited with error code: 128

Your project link(s)
GITHUB: GitHub - Infamou5/free-code-camp-backend: FreeCodeCamp - Backend

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:95.0) Gecko/20100101 Firefox/95.0

Challenge: Serve an HTML File

Link to the challenge:

I can see from your commit history that you have tried different URL types for the package, are you getting the same error no matter what type of URL you have used?

It should work with the original URL that is in the package.json file. Even just the user/repo format should work.

"fcc-express-bground": "freeCodeCamp/fcc-express-bground-pkg"

Anytime you change the URL you have to run npm install to update the lock file otherwise it won’t get updated and Heroku may just be using the lock file.

As an example right now you have this in your package.json

	"name": "fcc-learn-node-with-express",
	"version": "0.1.0",
	"dependencies": {
		"express": "^4.14.0",
		"body-parser": "^1.15.2",
		"cookie-parser": "^1.4.3",
		"fcc-express-bground": "github:freeCodeCamp/fcc-express-bground-pkg.git"	
	"main": "server.js",
	"scripts": {
		"start": "npm install && node server.js"

But this is in the lock file.

"node_modules/fcc-express-bground": {
	"version": "0.0.5",
	"resolved": "git+ssh://",
	"integrity": "sha512-+HXHCtd8IuwfXYZmofQqpQQRr2cZeo1uNzXVse4NDkpBR5pMGOGORLgCWgIyF2YlyI53xZfmKDVTR9UrLfyXmQ==",
	"license": "(BSD-3-Clause AND CC-BY-SA-4.0)"

As you can see they do not match. Try using the normal URL or user/repo version and update the lock file.

Otherwise, maybe try just deleting the package-lock.json file and see if that helps with the Heroku install.

Edit: here is a related issue.

If you can’t get it to work with Heroku I would suggest you just use Replit instead.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.