6

I am trying to deploy a web app on Heroku. I am getting the following error Error: Cannot find module '@heroku/buildpack-registry' I tried adding the version of node I am using but still didn't help. I also upgraded Heroku using npm i [email protected] this too didn't help. Any thoughts on this?

This is my package.json

{"name":"gssrDB",
  "engines": {
    "node": "14.18.0"
  }
  ,
  "scripts": {
    "dev": "nodemon index.js",
    "start": "node index.js"
  },
  "dependencies": {
    "@heroku-cli/plugin-buildpacks": "^7.54.0",
    "@heroku/buildpack-registry": "^1.0.1",
    "async-file": "^2.0.2",
    "cli-ux": "^4.9.3",
    "dotenv": "^9.0.2",
    "ejs": "^3.1.6",
    "ejs-mate": "^3.0.0",
    "express": "^4.17.1",
    "got": "^8.3.2",
    "heroku": "^7.59.0",
    "mongodb": "^3.6.6",
    "mongoose": "^5.12.9",
    "nodemon": "^2.0.13",
    "phoenix": "^1.6.0"
  }
}

3 Answers 3

21

I solved it like this in terminal

$ heroku plugins:install buildpack-registry
$ heroku plugins:install buildpacks  

may be it works

2

I faced a similar problem, and I solved it by using proper node version. For the current heroku version, node16 works, otherwise it cause error in buildpack

0

Two things helped in fixing this:

  1. update the heroku CLI
    npm install -g heroku
    
  2. Adding the engines in the package.json with the currently installed node and npm versions
    "node": "14.18.0",
    "npm": "7.6.3"
    } 
    

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.