On my up-to-date Arch Linux, apm is not working anymore:
~ $ apm
module.js:600
return process.dlopen(module, path._makeLong(filename));
^
Error: The module '/usr/lib/node_modules/atom-package-manager/node_modules/git-utils/build/Release/git.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 48. This version of Node.js requires
NODE_MODULE_VERSION 51. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or`npm install`).
at Object.Module._extensions..node (module.js:600:18)
at Module.load (module.js:490:32)
at tryModuleLoad (module.js:449:12)
at Function.Module._load (module.js:441:3)
at Module.require (module.js:500:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/usr/lib/node_modules/atom-package-manager/node_modules/git-utils/lib/git.js:8:16)
at Object.<anonymous> (/usr/lib/node_modules/atom-package-manager/node_modules/git-utils/lib/git.js:371:4)
at Module._compile (module.js:573:32)
at Object.Module._extensions..js (module.js:582:10)
I suspect this is because an update of Node.js was pulled in recently. I have Node.js version 7.0.0-1 installed.
Can you elaborate on how you've installed apm?
apm uses it's own bundled Node.js, so I suspect whatever AUR package you've used is doing something that is not officially supported. Assuming of course that you've used a package.
Additionally, apm is bundled with Atom, so I don't really see how this problem is possible when following the official guidelines for installing Atom (and thus by extension, apm).
I used the official atom package, no AUR involved. I'm not the only one with this problem either. So is this a bug related to Arch packaging?
I have the same problem, and i have installed atom (and, as a dependency of atom, apm 1.14.0-1) through the official repository (no AUR package).
What is the output of atom --version and apm --version?
atom --version:
Atom : 1.11.2
Electron: 1.4.4
Chrome : 53.0.2785.113
Node : 6.5.0
apm --version:
module.js:600
return process.dlopen(module, path._makeLong(filename));
^
Error: The module '/usr/lib/node_modules/atom-package-manager/node_modules/git-utils/build/Release/git.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 48. This version of Node.js requires
NODE_MODULE_VERSION 51. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or`npm install`).
at Object.Module._extensions..node (module.js:600:18)
at Module.load (module.js:490:32)
at tryModuleLoad (module.js:449:12)
at Function.Module._load (module.js:441:3)
at Module.require (module.js:500:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/usr/lib/node_modules/atom-package-manager/node_modules/git-utils/lib/git.js:8:16)
at Object.<anonymous> (/usr/lib/node_modules/atom-package-manager/node_modules/git-utils/lib/git.js:371:4)
at Module._compile (module.js:573:32)
at Object.Module._extensions..js (module.js:582:10)
There is no official Atom package for Arch — how did you install it?
The output provided by @bjornwsv clearly indicates an unofficial package since the output shows Electron v1.4.4. Official distributions of Atom v1.11.2 are shipped with Electron v0.37.8.
https://www.archlinux.org/packages/?name=atom
I installed the x86_64 variant.
Yup, that's not an official distribution of Atom. I suggest you open an issue on that end demanding they stop bundling unsupported versions of Electron. They need to adhere to the official Atom releases.
Since this is not a problem with apm or Atom, I'm closing this issue.
Thanks @thomasjo, I'll do that.
Just noticed that there is a related bug report already:
https://bugs.archlinux.org/task/50357?project=5&cat%5B0%5D=33&string=atom
You can read the two documents:
https://github.com/atom/design-decisions/blob/master/unofficial-atom-distributions.md
https://github.com/atom/design-decisions/blob/master/electron-update-procedure.md
For more information regarding these versions of Atom.
Actually, the correct Arch bugreport was this one: https://bugs.archlinux.org/task/51628
And the answer is that if apm is built against a system nodejs, then it needs to be rebuilt against the system nodejs on major updates. As explicitly mentioned in the error message!
Which has nothing whatsoever to do with Electron of whatever version...
It is of course still true that when using distro packages, one should test with the upstream blessed binaries and if you cannot reproduce the issue, then it is a distro packaging issue and therefore both inappropriate and unproductive to report an upstream bug. :wink:
(@cbrnr, On the unrelated Electron issue, I believe the Arch maintainer for the atom etc packages is pretty active in patching and filing PRs to fix issues caused by updating Electron, so you probably don't need to ditch the Arch package. Just keep in mind that bugs in an Arch package should first be assumed to be a bug in the Arch packaging.)
@eli-schwartz yes, sorry about the noise - I should have digged a little deeper into Atom before reporting this here. Also, you're right regarding the Arch package, the maintainer has already provided an update which fixes this issue!
try with npm rebuild
@rajktariya how many times i need run npm rebuild? 10 is good? or maybe more?)