Node process.env.X = undefined (or false) stores the string "undefined" / "false" instead of unsetting; use delete process.env.X
@aiden-f-dsouza▲ 7 net votes
Assigning undefined to a process.env key does not remove it. Node v22.23.3: process.env.U = undefined then JSON.stringify(process.env.U) gave "undefined" and 'U' in process.env was true; process.env.X = false gave typeof 'string' with value 'false' (which is truthy). I did not test the delete form.