社区所有版块导航
Python
python开源   Django   Python   DjangoApp   pycharm  
DATA
docker   Elasticsearch  
aigc
aigc   chatgpt  
WEB开发
linux   MongoDB   Redis   DATABASE   NGINX   其他Web框架   web工具   zookeeper   tornado   NoSql   Bootstrap   js   peewee   Git   bottle   IE   MQ   Jquery  
机器学习
机器学习算法  
Python88.com
反馈   公告   社区推广  
产品
短视频  
印度
印度  
Py学习  »  Python

h14在heroku上部署具有python依赖项的nodejs应用程序时出现代码错误

YOUNES ZADI • 5 年前 • 1603 次点击  

在Heroku上部署node.js应用程序时,出现了H14代码错误。应用程序调用一个python脚本,因此它有一些包依赖项。

我遵循文档,换句话说,我的构建包如下所示:

  1. heroku/nodejs
  2. heroku/python

我有一个 requirements.txt 根目录中的文件,以及 runtime.txt 包含 python-3.6.3 .

这个 package.json 其内容如下:

 {
  "name": "spam-community",
  "version": "1.0.0",
  "description": "This app is a spam and ham detector",
  "main": "index.js",
  "scripts": {
    "start": "node index.js",
    "server": "nodemon index.js"
  },
  "author": "Zadi younes",
  "license": "ISC",
  "dependencies": {
    "body-parser": "^1.18.3",
    "child_process": "^1.0.2",
    "cookie-parser": "^1.4.4",
    "express": "^4.16.4",
    "mongoose": "^5.4.17",
    "multer": "^1.4.1",
    "nodemailer": "^5.1.1",
    "nodemon": "^1.18.10",
    "sendmail": "^1.4.1"
  },
  "engines": {
    "node": "10.x"
  }
}

我试着用命令把网络恶魔也设为一个 heroku ps:scale web=1 但我明白了

找不到该进程类型(Web)

Python社区是高质量的Python/Django开发社区
本文地址:http://www.python88.com/topic/41182
 
1603 次点击  
文章 [ 1 ]  |  最新文章 5 年前
Chris
Reply   •   1 楼
Chris    6 年前

The order of your buildpacks is important :

列表中的最后一个构建包将用于确定 process types 为了申请。将忽略从早期构建包定义的任何进程类型。

你可以跑 heroku help buildpacks 获取命令的完整选项列表。

尝试移动 heroku/nodejs 之后 heroku/python :

heroku buildpacks:set heroku/nodejs
heroku buildpacks:add --index 1 heroku/python

使用验证您的构建包 heroku:buildpacks

如果你没有 Procfile . 在那种情况下 your start script will be run automatically 假设 Heroku/Nodejs酒店 是你的最后一个构建包。