Skip to content

Q: "node app.js" doesn't work after "grunt build" command #590

@mescalito

Description

@mescalito

thanks for your time! I'm new using yeoman so i don't know what is exactly going on .

When using the grunt build command everything seems to works fine and the "/dist" folder is generated ok, but why the node app.js command doesn't fully work inside the "/dist/server" folder?

To make my app working on the "/dist" folder I have to open file app.js and then in like no.8 change 'development' into 'production'

File app.js line no.8

process.env.NODE_ENV = process.env.NODE_ENV || 'development'; // change 'development' to 'production'
  • Do I need to do make that change every time I plan to deploy to the server?

After digging into the grunt.js I realized I can run this command grunt serve:dist and then the server seems to work fine, but obviously I won't have that option into my production server, I just want the "/dist" folder.

  • What am I doing wrong? and how can I run my project from the "/dist" folder on my production server?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions