Skip to content

Commit

Permalink
Deep copy process.config, needs for NodeJS 19+
Browse files Browse the repository at this point in the history
  • Loading branch information
panther7 committed Oct 24, 2023
1 parent f972394 commit a93ee95
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/configure.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,10 @@ function configure (gyp, argv, callback) {

log.verbose('build/' + configFilename, 'creating config file')

var config = process.config || {}
, defaults = config.target_defaults
, variables = config.variables
// In Node v19 process.config is now frozen, so we need to clone it
var config = JSON.parse(JSON.stringify(process.config || {}))
var defaults = config.target_defaults
var variables = config.variables

// default "config.variables"
if (!variables) variables = config.variables = {}
Expand Down

0 comments on commit a93ee95

Please sign in to comment.