LinusU / node-appdmg

💾 Generate your app dmgs
MIT License
1.7k stars 153 forks source link

Version mismatch error when installed via MacPorts #78

Closed jleaders closed 8 years ago

jleaders commented 8 years ago

On OSX, I need to use macports, because I run into issues with Brew. I uninstalled homebrew package manager and tried to get node to work:

I do a clean install of nodejs and npm

sudo port install nodejs npm

Let's just show that there is only npm installed, and no other modules.

$ ls /opt/local/lib/node_modules/ 
npm 

Trying to get a node package working, testing with appdmg

sudo npm install -g appdmg

Now here's the cryptic error. (NOTE: It worked with brew's version of NPM, earlier this morning)

$ appdmg
module.js:460
  return process.dlopen(module, path._makeLong(filename));
                 ^

Error: Module version mismatch. Expected 46, got 47.
    at Error (native)
    at Object.Module._extensions..node (module.js:460:18)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:311:12)
    at Module.require (module.js:366:17)
    at require (module.js:385:17)
    at Object.<anonymous> (/usr/local/lib/node_modules/appdmg/node_modules/macos-alias/lib/create.js:7:13)
    at Module._compile (module.js:435:26)
    at Object.Module._extensions..js (module.js:442:10)
    at Module.load (module.js:356:32)
dliessi commented 8 years ago

What version of OS X are you using?

(I'm using node and npm installed via MacPorts, too. I'm having problems with the latest versions of node, but I haven't examined the problem so far, both due to lack of time and because I thought that the problem is limited to old OS X versions (I'm on 10.6.8). If instead the problem is in MacPorts, I'll surely try to debug this.)

jleaders commented 8 years ago

I'm using 10.8.4 Mountain Lion. I tried with the latest version of node (5.1), and the older version (4.2) and got INVERSE results..

On 5.2, the message reads:

 Error: Module version mismatch. Expected 47, got 46.

On 4.2.2 I got

 Error: Module version mismatch. Expected 46, got 47.

Which lead me to believe there was some lingering brew version of node. So I ran this uninstall script and it fixed it, thanks to @nicerobot via https://gist.github.com/nicerobot/2697848:

curl -ksO https://gist.githubusercontent.com/nicerobot/2697848/raw/uninstall-node.sh
chmod +x ./uninstall-node.sh
./uninstall-node.sh
rm uninstall-node.sh
LinusU commented 8 years ago

Glad to see that you got it resolved :+1: