LinusU / node-appdmg

💾 Generate your app dmgs
MIT License
1.68k stars 152 forks source link

Error NODE_MODULE_VERSION 59 #156

Closed kenpingliu closed 6 years ago

kenpingliu commented 6 years ago

After I upgrade node by 'brew upgrade', I can not run appdmg now, how can I fix it?

module.js:670 return process.dlopen(module, path.toNamespacedPath(filename)); ^

Error: The module '/usr/local/lib/node_modules/appdmg/node_modules/macos-alias/build/Release/volume.node' was compiled against a different Node.js version using NODE_MODULE_VERSION 57. This version of Node.js requires NODE_MODULE_VERSION 59. Please try re-compiling or re-installing the module (for instance, using npm rebuild or npm install). at Object.Module._extensions..node (module.js:670:18) at Module.load (module.js:560:32) at tryModuleLoad (module.js:503:12) at Function.Module._load (module.js:495:3) at Module.require (module.js:585:17) at require (internal/module.js:11:18) at Object. (/usr/local/lib/node_modules/appdmg/node_modules/macos-alias/lib/create.js:7:13) at Module._compile (module.js:641:30) at Object.Module._extensions..js (module.js:652:10) at Module.load (module.js:560:32)

LinusU commented 6 years ago

It says right in the error message:

[...] was compiled against a different Node.js version using NODE_MODULE_VERSION 57. This version of Node.js requires NODE_MODULE_VERSION 59. Please try re-compiling or re-installing the module (for instance, using npm rebuild or npm install).

npm rebuild should work

kenpingliu commented 6 years ago

thanks, I have used "npm rebuild" "npm install" ....,but the issue exists also.

ubertil commented 6 years ago

Same here, used npm rebuild, uninstalled npm, etc. Still not working

cstruct commented 6 years ago

If rebuild doesn't work it's a NPM issue. You can always try to nuke your global node_modules directory and reinstall the package.

ubertil commented 6 years ago

I nuked the hell out my node_modules directory + uninstalled npm + reboot. Fixed the issue

kenpingliu commented 6 years ago

thanks, I fixed the issue by follows: rm -rf /usr/local/lib/node_modules/ brew uninstall node brew install node npm install -g appdmg