"was compiled against a different Node.js version"
Lohoris opened this issue · comments
I'm trying to run create-dmg
after a while, and I keep getting this error.
internal/modules/cjs/loader.js:752
return process.dlopen(module, path.toNamespacedPath(filename));
^
Error: The module '/usr/local/lib/node_modules/create-dmg/node_modules/macos-alias/build/Release/volume.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 64. This version of Node.js requires
NODE_MODULE_VERSION 67. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).
at Object.Module._extensions..node (internal/modules/cjs/loader.js:752:18)
at Module.load (internal/modules/cjs/loader.js:620:32)
at tryModuleLoad (internal/modules/cjs/loader.js:560:12)
at Function.Module._load (internal/modules/cjs/loader.js:552:3)
at Module.require (internal/modules/cjs/loader.js:659:17)
at require (internal/modules/cjs/helpers.js:22:18)
at Object.<anonymous> (/usr/local/lib/node_modules/create-dmg/node_modules/macos-alias/lib/create.js:7:13)
at Module._compile (internal/modules/cjs/loader.js:723:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:734:10)
at Module.load (internal/modules/cjs/loader.js:620:32)
I've tried to hard-rebuild it removing the node_modules
directory and reinstalling it, but nothing changed.
I'm a bit clueless about what to do, I've searched a lot and came out with nothing useful at all.
$ rm -rf /usr/local/lib/node_modules/create-dmg
and then reinstalling create-dmg
should do it. This happens when you upgrade an major Node.js version and then try to use a package with a native Node.js add-on, like we use in create-dmg
.
Ok great, I only removed the local node_modules
directory, didn't realise there was a global one. Thanks for the extremely quick response!
$ rm -rf /usr/local/lib/node_modules/create-dmg
and then reinstallingcreate-dmg
should do it. This happens when you upgrade an major Node.js version and then try to use a package with a native Node.js add-on, like we use increate-dmg
.
thanks, had the same problem and that solved it! :)