How to contribute to apm?


#1

(This might belong in Support, not sure)

I’m trying to hack on apm, and I built it by following the instructions in the README. The build went smoothly. When I try to run the local bin instead of the one in my $PATH I get an error:

$ ./bin/apm

module.js:356
  Module._extensions[extension](this, filename);
                               ^
Error: /home/mnq2/code/apm/node_modules/git-utils/build/Release/git.node: undefined symbol: node_module_register
  at Module.load (module.js:356:32)
  at Function.Module._load (module.js:312:12)
  at Module.require (module.js:364:17)
  at require (module.js:380:17)
  at Object.<anonymous> (/home/mnq2/code/apm/node_modules/git-utils/lib/git.js:8:16)
  at Object.<anonymous> (/home/mnq2/code/apm/node_modules/git-utils/lib/git.js:359:4)
  at Module._compile (module.js:456:26)
  at Object.Module._extensions..js (module.js:474:10)
  at Module.load (module.js:356:32)
  at Function.Module._load (module.js:312:12)
  at Module.require (module.js:364:17)
  at require (module.js:380:17)
  at Object.<anonymous> (/home/mnq2/code/apm/lib/publish.js:11:9)
  at Object.<anonymous> (/home/mnq2/code/apm/lib/publish.js:457:4)
  at Module._compile (module.js:456:26)
  at Object.Module._extensions..js (module.js:474:10)
  at Module.load (module.js:356:32)
  at Function.Module._load (module.js:312:12)
  at Module.require (module.js:364:17)
  at require (module.js:380:17)
  at Object.<anonymous> (/home/mnq2/code/apm/lib/apm-cli.js:35:245)
  at Object.<anonymous> (/home/mnq2/code/apm/lib/apm-cli.js:244:4)
  at Module._compile (module.js:456:26)
  at Object.Module._extensions..js (module.js:474:10)
  at Module.load (module.js:356:32)
  at Function.Module._load (module.js:312:12)
  at Module.require (module.js:364:17)
  at require (module.js:380:17)
  at Object.<anonymous> (/home/mnq2/code/apm/lib/cli.js:4:9)
  at Object.<anonymous> (/home/mnq2/code/apm/lib/cli.js:17:4)
  at Module._compile (module.js:456:26)
  at Object.Module._extensions..js (module.js:474:10)
  at Module.load (module.js:356:32)
  at Function.Module._load (module.js:312:12)
  at Function.Module.runMain (module.js:497:10)
  at startup (node.js:119:16)
  at node.js:929:3

I didn’t make any local changes to the code.

What am I missing? Is there another way to run apm from the command line in dev? The process for contributing to core packages that aren’t command line applications is pretty clear, but I’m not sure how this works with apm. (@kevinsawicki?)


Atom 0.172.0
Ubuntu 14.04.1 LTS

Forked from:
apm 0.119.0
npm 1.4.4
node 0.10.35
python 2.7.6
git 2.2.2


#2

What version of node and npm do you have installed on your machine?

The versions that apm prints out are the versions of npm and node that are bundled with apm, not the system versions.

So from the apm directory:

  • node -v
  • npm -v

#3

I’m running:

npm 1.4.9
node 0.10.28

for horrible dependency resolution reasons for a deprecated app I have to run for work. :confused:

Let me try again with the more up-to-date versions I have running with nvm.


#4

Same error with node v0.10.35 and npm 2.1.18 :confused:


#5

@kevinsawicki It’s definitely some kind of Linux build issue – I got it running on Yosemite without any problems. I’ll see what I can figure out.


#6

I can’t contribute to solving this issue, but if you want to use multiple versions of node you can use NVM: https://www.npmjs.com/package/nvm


#7

I’m having a similar problem on a system running Funtoo, specifically while trying to bootstrap atom-shell.

...
- bootstrap: /home/iwoloschin/atom-shell/node_modules/.bin/apm install

module.js:356
  Module._extensions[extension](this, filename);
                               ^
Error: /home/iwoloschin/atom-shell/node_modules/atom-package-manager/node_modules/git-utils/build/Release/git.node: undefined symbol: node_module_register
  at Module.load (module.js:356:32)
  at Function.Module._load (module.js:312:12)
  at Module.require (module.js:364:17)
  at require (module.js:380:17)
  at Object.<anonymous> (/home/iwoloschin/atom-shell/node_modules/atom-package-manager/node_modules/git-utils/lib/git.js:8:16)
  at Object.<anonymous> (/home/iwoloschin/atom-shell/node_modules/atom-package-manager/node_modules/git-utils/lib/git.js:359:4)
  at Module._compile (module.js:456:26)
  at Object.Module._extensions..js (module.js:474:10)
  at Module.load (module.js:356:32)
  at Function.Module._load (module.js:312:12)
  at Module.require (module.js:364:17)
  at require (module.js:380:17)
  at Object.<anonymous> (/home/iwoloschin/atom-shell/node_modules/atom-package-manager/lib/publish.js:11:9)
  at Object.<anonymous> (/home/iwoloschin/atom-shell/node_modules/atom-package-manager/lib/publish.js:457:4)
  at Module._compile (module.js:456:26)
  at Object.Module._extensions..js (module.js:474:10)
  at Module.load (module.js:356:32)
  at Function.Module._load (module.js:312:12)
  at Module.require (module.js:364:17)
  at require (module.js:380:17)
  at Object.<anonymous> (/home/iwoloschin/atom-shell/node_modules/atom-package-manager/lib/apm-cli.js:36:266)
  at Object.<anonymous> (/home/iwoloschin/atom-shell/node_modules/atom-package-manager/lib/apm-cli.js:245:4)
  at Module._compile (module.js:456:26)
  at Object.Module._extensions..js (module.js:474:10)
  at Module.load (module.js:356:32)
  at Function.Module._load (module.js:312:12)
  at Module.require (module.js:364:17)
  at require (module.js:380:17)
  at Object.<anonymous> (/home/iwoloschin/atom-shell/node_modules/atom-package-manager/lib/cli.js:4:9)
  at Object.<anonymous> (/home/iwoloschin/atom-shell/node_modules/atom-package-manager/lib/cli.js:17:4)
  at Module._compile (module.js:456:26)
  at Object.Module._extensions..js (module.js:474:10)
  at Module.load (module.js:356:32)
  at Function.Module._load (module.js:312:12)
  at Function.Module.runMain (module.js:497:10)
  at startup (node.js:119:16)
  at node.js:929:3


Traceback (most recent call last):
  File "script/bootstrap.py", line 127, in <module>
    sys.exit(main())
  File "script/bootstrap.py", line 35, in main
    update_atom_modules('spec')
  File "script/bootstrap.py", line 77, in update_atom_modules
    execute_stdout([apm, 'install'])
  File "/home/iwoloschin/atom-shell/script/lib/util.py", line 151, in execute_stdout
    execute(argv)
  File "/home/iwoloschin/atom-shell/script/lib/util.py", line 139, in execute
    raise e
subprocess.CalledProcessError: Command '['/home/iwoloschin/atom-shell/node_modules/.bin/apm', 'install']' returned non-zero exit status 8

Just for the record:

~/atom-shell ❯❯❯ node -v
v0.12.0
~/atom-shell ❯❯❯ npm -v
2.5.1

Happy to try some things out, but I’m kind of in over my head, so I’m not sure what else to do on my end at the moment.


#8

Did you install libgnome-keyring-dev before trying to build apm? I eventually got this working on Ubuntu by rm -rfing and starting over.


#9

I have libgnome-keyring installed, which I believe is the Gentoo/Funtoo equivalent?

Digging in a little bit, it looks like atom-package-manager has it’s own node binary, which is v0.10.35. Would that cause problems if the system node binary is v0.12.0?


#10

It shouldn’t – I had the same issue even when my system Node binary matched the one that ships with apm.

I’m not totally sure on this, but libgnome-keyring and libgnome-keyring-dev might be two distinct packages?

Did you install libgnome-keyring before trying to build apm, or after?


#11

I don’t see a libgnome-keyring-dev package available on either Gentoo or Funtoo, so I suspect it’s just the one? I’ve had libgnome-keyring installed for a while, and I’ve successfully installed atom-shell-0.20.7, but I was trying to upgrade and ran into this problem.


#12

Some distros provide packages libfoo which contain everything that’s needed to run a program based on the foo library, plus also libfoo-dev which contains things that are needed to compile a program based on the foo library. (Sometimes there is also libfoo-doc which contains the documentation.) If Funtoo works the way I think it does (compiles everything from source), then it probably doesn’t distinguish between these.

Maybe that helps to determine whether you’ve got the right package…