+ 1
Hosting web apps
I've been trying to host this app on heroku but I can't seem to get it right. I checked my logs and I'm getting this persistent error message: "NODE_ENV value of production did not match any deployment config file names " When I open the app,it's just a blank page. Anyone with any suggestions on how I can solve this??
13 Respuestas
+ 4
In your package.json, you have added to "scripts"
start: "node app.js"
?
+ 1
You need to have file named Procfile in the root folder.
It should contain the command to start your server, for example,
node index.js
Here is my video tutorial about deploying Node.js app on Heroku
+ 1
Akib Reza I read your link and see:
`To determine how to start your app, Heroku first looks for a Procfile. `
I don't see where it says "procfile is not necessary"
+ 1
Akib Reza Nice app
Yes in your /server/package.json
You have added start: "node app.js" to "scripts", and Heroku will run npm start when they don't find Procfile.
+ 1
Yeah, why wouldn't you. It's the general deployment operation. 😅. Scripts makes life 10 times easier. That's why I was asking for package.json file at first.
+ 1
Try to host your web app on glitch.com
0
What's your package.json like? Do you have a .env file?
There is a deployment doc heroku site. Follow it. Should work properly if you follow the docs.
0
Gordon procfile is not necessary in the latest heroku versions.
https://devcenter.heroku.com/articles/deploying-nodejs
0
Um, I have my apps running without them. So, 😶. Just created repos/apps through heroku command line and pushed. No procfile necessary.
You can try and build a sample project then just push to heroku master after creating a app. See if it fails or not.
I created a procfile for first project wasn't needed for the rest. Scripts ran from package.json directly.
0
https://edu-resource.herokuapp.com this is running without any proc file.
0
https://github.com/akibrezakhan/edu-resource
Here is the source code.
0
Hey Gordon and Akib Reza ,you guys seem to know a thing or two about web apps.Ive been getting this error in my application for a long time.
Everytime I try to deploy it to heroku,I get this error "NODE_ENV value of production does not match any deployment config files".
Would you mind checking it out and trying to help me fix it??
The github link is:
https://github.com/Oxymusic/sample
I.e under the master branch.Not main branch.
0
I have attached a Readme file on how to set it up.
Thank you