How can I pass NODE_ENV into npm run command as parameter?
Example package.json file:
NODE_ENV=8080
...
"script": {
"start": "http-server --port $NODE_ENV" // or something similar that
}
...
Note that NODE_ENV is set by another process, the npm run only can be read from it.
I met this problem when deploying my app into heroku (they will automatically set NODE_ENV). I found another solution for this problem on heroku but I still wanna to know if there is a way to pass NODE_ENV into npm run command.