jprichardson / node-fs-extra

Node.js: extra methods for the fs object like copy(), remove(), mkdirs()
MIT License
9.44k stars 776 forks source link

Incompatible with Nexe packaging tool while using fs-extra 10.0.0 #909

Closed donthijackthegit closed 3 years ago

donthijackthegit commented 3 years ago

I am using Nexe to package my service into an executable file. Compilation was success, but when I run the app, I got below error message:

 }, 'name', { value: fn.name })
                         ^

TypeError: Cannot read property 'name' of undefined
    at exports.fromCallback (/***/dist/nexe/node_modules/universalify/index.js:15:26)
    at Object.<anonymous> (/***/dist/nexe/node_modules/fs-extra/lib/fs/index.js:57:27)
    at Module._compile (internal/modules/cjs/loader.js:1085:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
    at Module.load (internal/modules/cjs/loader.js:950:32)
    at Function.Module._load (internal/modules/cjs/loader.js:790:14)
    at Module.require (internal/modules/cjs/loader.js:974:19)
    at require (internal/modules/cjs/helpers.js:92:18)
    at Object.<anonymous> (/***/dist/nexe/node_modules/fs-extra/lib/index.js:5:6)
    at Module._compile (internal/modules/cjs/loader.js:1085:14)

I switch back to fs-extra 9.1.0 everything works fine.

Cannot reproduce if run directly via node.

RyanZim commented 3 years ago

This is a bug with Nexe, it looks like they don't support fs.realpath.native.