node-unzip
node-unzip copied to clipboard
Not working with Node 12, primordials is not defined
With Node 12, simply doing a require("unzip") will crash your application with the following error:
const { Math, Object, Reflect } = primordials;
^
ReferenceError: primordials is not defined
at fs.js:27:35
at req_ (/home/martin/works/XXX/node_modules/natives/index.js:143:24)
at Object.req [as require] (/home/martin/works/XXX/node_modules/natives/index.js:55:10)
at Object.<anonymous> (/home/martin/works/XXX/node_modules/fstream/node_modules/graceful-fs/fs.js:1:37)
at Module._compile (internal/modules/cjs/loader.js:759:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:770:10)
at Module.load (internal/modules/cjs/loader.js:628:32)
at Function.Module._load (internal/modules/cjs/loader.js:555:12)
at Module.require (internal/modules/cjs/loader.js:666:19)
at require (internal/modules/cjs/helpers.js:16:16)
Had the same issue on my project. Moved to unzipper fork instead, since this project seems abandoned unfortunately
The error I was getting when requiring this after the upgrade to node 12 is this:
/usr/local/bin/node[190]: ../src/node_contextify.cc:651:static void node::contextify::ContextifyScript::New(const v8::FunctionCallbackInfo<v8::Value>&): Assertion `args[1]->IsString()' failed.
Hopefully will save someone else some time since search was coming up pretty empty on that one
Same root cause as https://github.com/EvanOxfeld/node-unzip/issues/115
I changed my node version to 10.16.0, and it works