How to change NODE_ENV for netlify functions

Thanks for your reply, but I’m running in a pretty weird issue with process.env.CONTEXT.

When I run CONTEXT=development netlify dev netlify starts an endless loop and Lambda server keeps switching ports. Not exactly sure what can cause it:

 ✘ ✝  ~/dev/gatsby-dev-blog-starter   master±  yarn develop
yarn run v1.12.3
$ CONTEXT=development netlify dev
◈ Netlify Dev ◈
◈ Injected build setting env var:  GATSBY_DEV_GITHUB_CLIENT_ID
◈ Injected build setting env var:  GATSBY_DEV_GITHUB_CLIENT_SECRET
◈ Injected build setting env var:  GATSBY_DEV_HOST_URL
◈ Injected build setting env var:  GATSBY_FUNCTION_PASSWORD
◈ Injected build setting env var:  GATSBY_GITHUB_CLIENT_ID
◈ Injected build setting env var:  GATSBY_GITHUB_CLIENT_SECRET
◈ Injected build setting env var:  GATSBY_HOST_URL
◈ Injected build setting env var:  GATSBY_DEV_FUNCTION_PASSWORD
◈ Starting Netlify Dev with gatsby
Waiting for localhost:8000.
◈ Lambda server is listening on 34567
$ npm run develop
npm WARN lifecycle The node binary used for scripts is /var/folders/s7/vtbv89nd3f99nlx5y9h94qk00000gn/T/yarn--1560352104668-0.36838903564793/node but npm is using /Users/skok/.nvm/versions/node/v11.5.0/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.

> gatsby-dev-blog-starter@0.1.0 develop /Users/skok/dev/gatsby-dev-blog-starter
> CONTEXT=development netlify dev

.◈ Netlify Dev ◈
.◈ Starting Netlify Dev with gatsby
Waiting for localhost:8000.
◈ Lambda server is listening on 55396
$ npm run develop
.npm WARN lifecycle The node binary used for scripts is /var/folders/s7/vtbv89nd3f99nlx5y9h94qk00000gn/T/yarn--1560352107238-0.9451571250276476/node but npm is using /Users/skok/.nvm/versions/node/v11.5.0/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.

> gatsby-dev-blog-starter@0.1.0 develop /Users/skok/dev/gatsby-dev-blog-starter
> CONTEXT=development netlify dev

..◈ Netlify Dev ◈
.◈ Starting Netlify Dev with gatsby
.Waiting for localhost:8000.
◈ Lambda server is listening on 55412
$ npm run develop
.npm WARN lifecycle The node binary used for scripts is /var/folders/s7/vtbv89nd3f99nlx5y9h94qk00000gn/T/yarn--1560352109773-0.46483751576396815/node but npm is using /Users/skok/.nvm/versions/node/v11.5.0/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.

> gatsby-dev-blog-starter@0.1.0 develop /Users/skok/dev/gatsby-dev-blog-starter
> CONTEXT=development netlify dev

...◈ Netlify Dev ◈
.. ◈ Starting Netlify Dev with gatsby
.Waiting for localhost:8000.
◈ Lambda server is listening on 55436
$ npm run develop
..npm WARN lifecycle The node binary used for scripts is /var/folders/s7/vtbv89nd3f99nlx5y9h94qk00000gn/T/yarn--1560352112263-0.5329314860894214/node but npm is using /Users/skok/.nvm/versions/node/v11.5.0/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.

> gatsby-dev-blog-starter@0.1.0 develop /Users/skok/dev/gatsby-dev-blog-starter
> CONTEXT=development netlify dev

Here is the link on netlify functions in my repo - https://github.com/iamskok/gatsby-dev-blog-starter/tree/master/.netlify/functions