Why does Heroku fail to detect Node.js buildpack?

前端 未结 7 850
慢半拍i
慢半拍i 2020-12-14 16:18

I git cloned a Node.js application (the version specified in the package.json being 4.1.2 and that of my local machine being 6.2.2) an

相关标签:
7条回答
  • 2020-12-14 17:06

    Some tiny clarifications on other answers: The error "Failed to detect set buildpack https://codon-buildpacks.s3.amazonaws.com/buildpacks/heroku/nodejs.tgz" or anything similar, means to say the GIT COMMIT you are trying to push to heroku was not DETECTED as a node.js app. (Note the capitals for subtleties).

    I recently made a stupid mistake that made me aware of this: Running "ls -a" showed that my package.json and .git files were in the same root directory, as required by heroku. EXCEPT that the package.json file WAS NOT included in my latest git commit. Running "git status" alerted me that package.json was an untracked file. So I added it, and ta-da, pushing to heroku worked.

    If you get an error related to buildpack, check that your GIT COMMIT has a package.json file in the root directory. If this is true, try manually specifying the buildpack with "heroku buildpacks:set heroku/nodejs" (or your desired language). This should resolve most errors related to buildpack detection.

    0 讨论(0)
提交回复
热议问题