Expressjs not loading stylesheets on heroku, giving 500 error

后端 未结 3 1122
说谎
说谎 2021-01-01 04:20

I\'m running an Expressjs installation on heroku, and it\'s not loading the stylesheets.

I hit ctrl+u and then click on the stylesheet link, and get this error:

相关标签:
3条回答
  • 2021-01-01 04:46

    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"
      }
    }
    
    0 讨论(0)
  • 2021-01-01 04:49

    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

    0 讨论(0)
  • 2021-01-01 05:03

    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)

    0 讨论(0)
提交回复
热议问题