Heroku 并没有阻止 Node.js 构建包



我正在使用Heroku并尝试部署我的代码,但是当我尝试部署时出现错误。

它说它没有检测到任何构建包,但我已经进行了版本检查并安装了最新的 Node.js。

我错过了什么吗?

终端:

Creating app... done, ⬢ boiling-lake-07398
https://boiling-lake-07398.herokuapp.com/ | https://git.heroku.com/boiling-lake-07398.git
Shons-MacBook-Pro:Newsletter-Signup shonswope$ git push heroku master
Enumerating objects: 1305, done.
Counting objects: 100% (1305/1305), done.
Delta compression using up to 4 threads
Compressing objects: 100% (1248/1248), done.
Writing objects: 100% (1305/1305), 1.87 MiB | 455.00 KiB/s, done.
Total 1305 (delta 179), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote: 
remote:  !     No default language could be detected for this app.
remote:                         HINT: This occurs when Heroku cannot detect the buildpack to use for this a
pplication automatically.
remote:                         See https://devcenter.heroku.com/articles/buildpacks
remote: 
remote:  !     Push failed
remote: Verifying deploy...
remote: 
remote: !       Push rejected to pacific-bastion-08294.
remote: 
To https://git.heroku.com/pacific-bastion-08294.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/pacific-bastion-08294.git'
Shons-MacBook-Pro:Newsletter-Signup shonswope$ npm --version
6.12.0
Shons-MacBook-Pro:Newsletter-Signup shonswope$ node --version
v12.13.0
Shons-MacBook-Pro:Newsletter-Signup shonswope$ git --version
git version 2.24.3 (Apple Git-128)
Shons-MacBook-Pro:Newsletter-Signup shonswope$ 

不过,按照错误消息中提到的文档,尝试显式设置构建包:

heroku buildpacks:set heroku/nodejs

如果删除或重命名以前导致自动检测应用程序类型的文件,从而在应用程序上自动设置检测到的构建包,也可能会出现这种情况。

还要检查此问题的答案以及您的package.json内容。
如此处所示,该package.jsonProcfile必须位于项目的根文件夹中。

最新更新