gpt4 book ai didi

Heroku 未检测到 Node.js 应用程序

转载 作者:太空宇宙 更新时间:2023-11-04 03:14:58 26 4
gpt4 key购买 nike

我在 Visual Studio 中创建了一个小型网站,并使用了 Node.js 和 Express。我可以通过 Visual Studio 和 Heroku 本地网络访问它。但是,当尝试将其推送到 Heroku 时,我收到错误:'heroku/nodejs' buildpack 不支持应用程序

我阅读了Heroku提供的文档,但没有找到任何解决方案。

ERROR: Application not supported by 'heroku/nodejs' buildpack
remote: !
remote: ! The 'heroku/nodejs' buildpack is set on this application, but was
remote: ! unable to detect a Node.js codebase.
remote: !
remote: ! A Node.js app on Heroku requires a 'package.json' at the root of
remote: ! the directory structure.
remote: !
remote: ! If you are trying to deploy a Node.js application, ensure that this
remote: ! file is present at the top level directory. This directory has the
remote: ! following files:
remote: !
remote: ! Portfolio/
remote: ! Portfolio.sln
remote: !
remote: ! If you are trying to deploy an application written in another
remote: ! language, you need to change the list of buildpacks set on your
remote: ! Heroku app using the 'heroku buildpacks' command.
remote: !
remote: ! For more information, refer to the following documentation:
remote: ! https://devcenter.heroku.com/articles/buildpacks
remote: ! https://devcenter.heroku.com/articles/nodejs-support#activation

最佳答案

此错误输出非常简单 - 确保您的 package.json 位于项目的顶级目录中,然后再次尝试部署。根据您的评论,package.json 似乎位于 {project_root}/Portfolio/package.json 而不是 {project_root}/package.json

关于Heroku 未检测到 Node.js 应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57946799/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com