Skip to content

Setting NODE_ENV value on windows #12

@jj-plane

Description

@jj-plane

Hi Simon. I'm on page 157 of then 2nd edition of Getting-Mean and I'm having an issue with the section:

TESTING BEFORE LAUNCHING

When I try to run the following command
NODE_ENV=production MONGODB_URI=mongodb://<username>:<password>@<hostname>:<port>/<database> nodemon
in my console I get the following error:

'NODE_ENV' is not recognized as an internal or external command,
operable program or batch file.

I'm on a windows machine and I'm pretty sure that the problem is that I'm running from a command prompt. I found the following stack overflow question.
https://stackoverflow.com/questions/11928013/node-env-is-not-recognized-as-an-internal-or-external-command-operable-comman/40967643#40967643

I was wondering what you recommend here?

Seems like a lot of people recommend https://www.npmjs.com/package/cross-env

But I'm not sure if that will allow me to test my mLab database locally. I'm pretty sure I have all my code correct. And I set up the database in heroku (using mLab) with no issues. But I want to make sure I can properly connect to that remote database before moving on to chapter 6.

Thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions