Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

apm not working with latest Node.js version #635

Closed
cbrnr opened this issue Nov 2, 2016 · 15 comments
Closed

apm not working with latest Node.js version #635

cbrnr opened this issue Nov 2, 2016 · 15 comments
Labels

Comments

@cbrnr
Copy link

cbrnr commented Nov 2, 2016

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.

@thomasjo
Copy link
Contributor

thomasjo commented Nov 2, 2016

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).

@cbrnr
Copy link
Author

cbrnr commented Nov 2, 2016

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?

@bjornwsv
Copy link

bjornwsv commented Nov 2, 2016

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).

@Ben3eeE
Copy link

Ben3eeE commented Nov 2, 2016

What is the output of atom --version and apm --version?

@bjornwsv
Copy link

bjornwsv commented Nov 2, 2016

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)

@thomasjo
Copy link
Contributor

thomasjo commented Nov 2, 2016

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.

@cbrnr
Copy link
Author

cbrnr commented Nov 2, 2016

https://www.archlinux.org/packages/?name=atom

I installed the x86_64 variant.

@thomasjo
Copy link
Contributor

thomasjo commented Nov 2, 2016

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.

@cbrnr
Copy link
Author

cbrnr commented Nov 2, 2016

Thanks @thomasjo, I'll do that.

@Ben3eeE Ben3eeE added the invalid label Nov 2, 2016
@cbrnr
Copy link
Author

cbrnr commented Nov 2, 2016

Just noticed that there is a related bug report already:
https://bugs.archlinux.org/task/50357?project=5&cat%5B0%5D=33&string=atom

@Ben3eeE
Copy link

Ben3eeE commented Nov 2, 2016

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.

@eli-schwartz
Copy link

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. 😉

(@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.)

@cbrnr
Copy link
Author

cbrnr commented Nov 4, 2016

@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!

@rajktariya
Copy link

rajktariya commented Jan 9, 2017

try with npm rebuild

@OpakAlex
Copy link

@rajktariya how many times i need run npm rebuild? 10 is good? or maybe more?)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

7 participants