fix: can't load module error when app is packaged
due to change in node.js(https://github.com/nodejs/node/issues/17076) internalModuleReadFile has been renamed to internalModuleReadJSON, and in vendor/node/lib/internal/modules/cjs/loader.js it will call internalModuleReadJSON and result in can't read the package.json file.
This commit is contained in:
parent
295c823a1b
commit
10df019075
1 changed files with 3 additions and 3 deletions
|
@ -590,11 +590,11 @@
|
||||||
return files
|
return files
|
||||||
}
|
}
|
||||||
|
|
||||||
const {internalModuleReadFile} = process.binding('fs')
|
const {internalModuleReadJSON} = process.binding('fs')
|
||||||
process.binding('fs').internalModuleReadFile = function (p) {
|
process.binding('fs').internalModuleReadJSON = function (p) {
|
||||||
const [isAsar, asarPath, filePath] = splitPath(p)
|
const [isAsar, asarPath, filePath] = splitPath(p)
|
||||||
if (!isAsar) {
|
if (!isAsar) {
|
||||||
return internalModuleReadFile(p)
|
return internalModuleReadJSON(p)
|
||||||
}
|
}
|
||||||
const archive = getOrCreateArchive(asarPath)
|
const archive = getOrCreateArchive(asarPath)
|
||||||
if (!archive) {
|
if (!archive) {
|
||||||
|
|
Loading…
Reference in a new issue