LinusU / node-appdmg

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

Error: Cannot find module '../build/Release/volume.node' #154

Closed shubh802 closed 5 years ago

shubh802 commented 6 years ago

while running below command am getting this error....

appdmg ./CTFAppCreation.json ./DCM.dmg module.js:538 throw err; ^

Error: Cannot find module '../build/Release/volume.node' at Function.Module._resolveFilename (module.js:536:15) at Function.Module._load (module.js:466:25) at Module.require (module.js:579: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:635:30) at Object.Module._extensions..js (module.js:646:10) at Module.load (module.js:554:32) at tryModuleLoad (module.js:497:12) at Function.Module._load (module.js:489:3)

shubh802 commented 6 years ago

I have tried re installing appdmg

anurag-sinha commented 6 years ago

TO workaround the issue, we remove the reference to Volume.node and tried hard-coding it;s usage. Post that it was able to move ahead but then failed at ./build/Release/xattr module not found. Any suggestions?

shubh802 commented 6 years ago

We are able to solve this actually appdmg uses node-gyp module as the dependency, node-gyp module could only work with python 2.7 it does not support python3.4 so by uninstalling and reinstalling appdmg from python 2.7 resolved it by below command npm install -g appdmg --python=python2.7

noahott commented 6 years ago

I'm still seeing this error and only have Python 2.7 installed. I'm running MacOS High Sierra 10.13.3

rendertom commented 6 years ago

Same issue here on OSx 10.12.6 Running npm install -g appdmg --python=python2.7 did not help.

shubh802 commented 6 years ago

Can you give some more details I remember I have to rebuild node-gyp module

obiwankennedy commented 6 years ago

same issue here, I have MacOS High Sierra 10.13.3 and it does not work

dvdsosa commented 6 years ago

I got it working... this was in my case related with electron-forge, so I removed node_modules folder on /opt/local/lib/node_modules/electron-forge/node_modules and did "sudo npm i" and that's all!

scottcarter commented 6 years ago

I also hit this problem. My npm packages were being installed to /usr/local/lib/node_modules

I tried installing appdmg as root, but was getting an EACCES error. This is referenced at How to Install Global Packages

The solution for me was to install npm packages to my local directory as mentioned at How to Prevent Permissions Errors (I chose Option Two: Change npm's Default Directory).

After switching to a local directory install, "npm install -g appdmg" worked perfectly.

LinusU commented 5 years ago

As mentioned before, node-gyp requires Python 2.x. Happy to reopen if the issue persists...

aimerib commented 4 years ago

For anyone coming here from the distant future using an electron-forge project, the version of appdmg used by that project is outdated, and had a dependency of fs-xattr lower than 0.3. node-gyp fails to compile fs-xattr on node v12 as per this issue

For me, the fix was to update fs-xattr to a newer version. Another possible fix (untested as of yet) would be to update appdmg directly since as of the current version of appdmg it depends on the correct version of fs-xattr for newer versions of node.