adobe / adobeio-cna-starter-project

DEPRECATED - Please use https://github.com/adobe/aio-cli to manage your future apps!
https://adobe.io
Apache License 2.0
10 stars 8 forks source link

Issue5: 'NODE_ENV' not recognized on Windows #7

Closed macdonst closed 5 years ago

macdonst commented 5 years ago

Uses cross_env package to set environment variables on windows, mac and unix.

Description

Update the package.json file to use cross_env package to set environment variables on windows, mac and unix. Also changed how $NODE_DEBUG_OPTION is passed into nodemon to make it cross platform.

Related Issue

5

Motivation and Context

Fixes windows bug

How Has This Been Tested?

Tested on my Macbook and Surface Laptop.

Screenshots (if appropriate):

Types of changes

Checklist:

macdonst commented 5 years ago

@moritzraho I rebased my branch with master, made the change and pushed to this PR. Should be up to date now.

moritzraho commented 5 years ago

@macdonst thanks a lot ! Sorry for the late suggestion but have you considered using a package like: https://github.com/laggingreflex/win-node-env ? (just found this) This eliminates the need of putting the cross-env keyword in front of every ENV var, which will likely be forgotten by osx and linux devs

moritzraho commented 5 years ago

Maybe we could even just say in the readme that win users should run npm config set script-shell "C:\\Program Files\\git\\bin\\bash.exe" (from https://stackoverflow.com/a/46006249). Git should be installed anyways to clone this project. Then we are sure there are no problems with the scripts anymore (thinking at &&, ||, .. bash operators)

macdonst commented 5 years ago

@moritzraho it's your project I'm just sending a PR that I think resolves the issue. You folks don't have to merge it if you don't want to.

In my opinion you want this starter project to be as frictionless as possible. So if you can support an out of the box solution on Windows without requiring users to install any additional packages or configuring a shell than that is how I would do it.

moritzraho commented 5 years ago

@macdonst spoke to the team, frictionless is the way to go, I will merge this one now, thanks :)