简体   繁体   English

无法在Heroku上使用节点运行Express

[英]Cannot run express with node on Heroku

I've deployed my app on Heroku and I have an express script that should wait for a post request. 我已经在Heroku上部署了我的应用程序,并且我有一个表达脚本,应该等待发布请求。 I need to run it separately on Heroku. 我需要在Heroku上单独运行它。 When I open the console on Heroku and type: 当我在Heroku上打开控制台并键入:

heroku run bash node scripts/start_express.js

I get the following error: 我收到以下错误:

/app/.heroku/node/bin/node: /app/.heroku/node/bin/node: cannot execute binary file

How do I use node to run my js file on Heroku? 如何使用节点在Heroku上运行js文件?

The node buildpack for heroku will automatically look for npm start script in your package.json file. 用于heroku的节点buildpack将自动在package.json文件中查找npm start脚本。 That is where you can specify which file to serve up. 您可以在此处指定要提供的文件。 Check this article out for some help on node and heroku https://devcenter.heroku.com/articles/nodejs-support 查阅本文以获取有关node和heroku的一些帮助https://devcenter.heroku.com/articles/nodejs-support

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM