From b54e56a4345df316c6d16f60042db0a83948cc61 Mon Sep 17 00:00:00 2001 From: ShuangLiu Date: Tue, 2 Nov 2021 18:23:30 +0800 Subject: [PATCH] fix process.version in electron unable to access process.version in electron should be globeal.process --- lib/default-encoding.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/default-encoding.js b/lib/default-encoding.js index 3042099..4b6b622 100644 --- a/lib/default-encoding.js +++ b/lib/default-encoding.js @@ -3,7 +3,7 @@ var defaultEncoding if (global.process && global.process.browser) { defaultEncoding = 'utf-8' } else if (global.process && global.process.version) { - var pVersionMajor = parseInt(process.version.split('.')[0].slice(1), 10) + var pVersionMajor = parseInt(global.process.version.split('.')[0].slice(1), 10) defaultEncoding = pVersionMajor >= 6 ? 'utf-8' : 'binary' } else {