Skip to content

In the electronic application, when I start nodeintegration, the program appears default-encoding.js? 9f9d:10 Uncaught TypeError: Cannot read property 'split' of undefinedΒ #103

@hrm476

Description

@hrm476

var defaultEncoding
/* istanbul ignore next */
if (global.process && global.process.browser) {
defaultEncoding = 'utf-8'
} else if (global.process && global.process.version) {
console.log('process.version', process.version) // undefined
console.log('global.process.version', global.process.version) // v12.18.3

// This line needs to be modified to "global.process.version"
// var pVersionMajor = parseInt(process.version.split('.')[0].slice(1), 10)

// like this
var pVersionMajor = parseInt(global.process.version.split('.')[0].slice(1), 10)

defaultEncoding = pVersionMajor >= 6 ? 'utf-8' : 'binary'

} else {
defaultEncoding = 'utf-8'
}
module.exports = defaultEncoding

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions