After upgraded my app to 3.1, I have this warning:
(node:1225965) Warning: The `util._extend` API is deprecated. Please use Object.assign() instead.
(Use `node --trace-warnings ...` to show where the warning was created)
To add nodejs configuration flags, you need to use environment variables, as you have found out.
One or two things may make this not work as you expect:
For some (all?) flags, when sent via an environment, dashes must be replaced with underscore. An example is --max-old-space-size. This can only be set as max_old_space_size so this could be true also for --trace-warnings: Set trace_warnings instead (with an underscore). Edit: this seems to be only for V8 options so should not apply here
If the warning comes from the meteor build phase (as opposed to when your app is running), you must use the TOOL_NODE_FLAGS environment variable instead.
Here are the options we use in a .circleci/config file to add more memory during test runs but much more for building (since Typescript gobbles up so much memory).
You’re right. trace-warnings flag works when I use TOOL_NODE_FLAGS env.
TOOL_NODE_FLAGS=--trace-warnings
(node:2181344) Warning: The `util._extend` API is deprecated. Please use Object.assign() instead.
at node:internal/util:116:11
at deprecated (node:internal/util:163:7)
at ProxyServer.<anonymous> (/home/minhna/.meteor/packages/meteor-tool/.3.1.0.irpbm0.oxkl++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/http-proxy/lib/http-proxy/index.js:50:26)
at /tools/runners/run-proxy.js:214:41
at attempt (/tools/runners/run-proxy.js:194:16)
at Proxy._tryHandleConnections (/tools/runners/run-proxy.js:214:9)
at Server.<anonymous> (/tools/runners/run-proxy.js:56:12)
at Server.emit (node:events:518:28)
at parserOnIncoming (node:_http_server:1150:12)
at HTTPParser.parserOnHeadersComplete (node:_http_common:117:17)