Expressjs not loading stylesheets on heroku, giving 500 error

℡╲_俬逩灬. 提交于 2019-11-30 10:16:45

I was able to solve this by specifying the engine dependencies in the package.json

{
  "name": "app-name",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "start": "node app"
  },
  "dependencies": {
    "express": "3.0.0rc1",
    "jade": "*",
    "stylus": "*"
  },
  "engines": {
    "node": "0.8.4",
    "npm": "1.1.41"
  }
}

I found the answer! you got a wrong runtime of the application push to the cloud you can do this

vmc push yourappname --runtime node08

i hope i can help you

I just had the same problem and found that running the following command (via Heroku CLI) worked for me:

heroku config:add NODE_ENV=production

This was in conjunction with specifying the versions of Node and NPM as Silas mentioned.

(via http://quickleft.com/blog/getting-started-with-express-in-node)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!