简体   繁体   中英

Heroku cannot find ./node_modules/.bin/forever in Procfile of Yeoman MEAN app

I've been trying to get a Yeoman generated MEAN.js app deployed to Heroku for the best part of a day without much luck. I've carefully gone through all the steps and am pretty sure I've done everything correctly according to documentation. After several times going through and ensuring the database is configured correctly with heroku config , removing the public/dist folder from the .gitignore , running grunt build , setting NODE_ENV=production , and running a successful Heroku build the app just continuously shows the very unhelpful Heroku Application Error page.

Upon checking the heroku logs the only thing I can find is this:

bash: ./node_modules/.bin/forever: No such file or directory
Process exited with status 127

Which clearly refers to the Procfile that contains this single line and is where the app is supposed to start from.

web: ./node_modules/.bin/forever -m 5 server.js

There is a server.js in the root of the project so I tried modifying the Procfile to a standard web: node server.js but that doesn't fix it and I am not comfortable messing with the default Yeoman configuration.

The ./node_modules/.bin/forever is of course there where it is supposed to be. But it obviously isn't showing up or cannot be located in the live Heroku build. If anyone knows what the problem is here and how to fix it I'd much appreciate the help! Cheers!

This happened to me after I upgraded my nodejs, I can't figure out why exactly it is happening, but here is my fix for it asap,

When I ran heroku run ls node_modules/.bin/ I could not find forever there. So I installed and save it to my dependencies by running npm install forever --save

On running heroku run ls node_modules/.bin/ again, it was there and my app runs fine. I'll sure update this soon, once I figure what exactly led to it.

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