From 7033e6a98bab96d339199e326b56106d7e98a982 Mon Sep 17 00:00:00 2001 From: diegozhu Date: Sun, 7 Feb 2021 12:11:28 +0800 Subject: [PATCH] fix: build.js remove comments issue some user may use git Windows-style line-ending which will result in JSON.parse error. --- lib/build.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/build.js b/lib/build.js index 0bcc9bea19..c122b9ff18 100644 --- a/lib/build.js +++ b/lib/build.js @@ -52,7 +52,7 @@ async function build (gyp, argv) { } } - config = JSON.parse(data.replace(/#.+\n/, '')) + config = JSON.parse(data.replace(/#.+\r?\n/, '')) // get the 'arch', 'buildType', and 'nodeDir' vars from the config buildType = config.target_defaults.default_configuration