简体   繁体   中英

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. I need to run it separately on Heroku. When I open the console on Heroku and type:

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?

The node buildpack for heroku will automatically look for npm start script in your package.json file. 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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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