Apm build issue


I just cloned apm to fix a bug I found, but running some of apm’s commands return nothing. For example .\bin\apm.cmd list (am on Windows) returns nothing. Same goes for installing packages. While .\bin\apm.cmd help does work.
Besides that, some of the tests are failing. Most of them related to installing packages.

Any ideas what I’m doing wrong?

$ .\bin\apm -v
apm  1.15.0
npm  3.10.5
node 4.4.5 x64
python 2.7.8
git 2.10.0.windows.1
visual studio 2015


Did you run npm install before you tried to build apm?


Yes, I did.

I followed the brief instructions.


Hmmmmm … I followed them too and things just worked. I’m not sure what could be going wrong. Can you get the tests to work if you just try to run things from master without your changes?


Tests fail with clean master too.

Just to make sure I have done it correctly … but apm should work while running .\bin\apm.cmd list to get all packages from Atom?

I’ll try a clean install.

Edit: still failed tests…


Running ./bin/apm list works for me, yes. I’m on a Mac though. I don’t have a Windows machine handy to test the same there though. I’ll see if someone else can help out or try and get a chance to work on it tomorrow.


Thanks @leedohm that would be great.

I have a fix implemented in the installed compiled apm version that I would like to transfer to coffeescript and add tests for.


So, after a lot of debugging I noticed ATOM_RESOURCE_PATH variable. When setting it with the location of atom, at least the .\bin\apm.cmd list command is now working:

$ set ATOM_RESOURCE_PATH=C:\Users\<user>\AppData\Local\atom\app-1.13.0-beta2\resources\app

Now is my question, does setting this variable have (side-)effect on my Atom usage?
And do I need to manually update the version everything a new (beta) Atom is released?

Running the following command .\bin\apm.cmd update still doesn’t work, but at least it creates an error now (will investigate tomorrow):

            throw new Error('Could not determine Electron version');

Error: Could not determine Electron version
    at C:\Users\<user>\Documents\GitHub\apm\lib\command.js:147:19
    at C:\Users\<user>\Documents\GitHub\apm\lib\command.js:165:20
    at C:\Users\<user>\Documents\GitHub\apm\lib\apm.js:40:18
    at nextTickCallbackWith0Args (node.js:420:9)
    at process._tickCallback (node.js:349:13)
    at Function.Module.runMain (module.js:443:11)
    at startup (node.js:139:18)
    at node.js:968:3

P.s. maybe important; I’ve not build Atom.


Sorry for not getting back to you right away. There was some construction in front of my house and they killed my internets until late yesterday.

This update gives me a bunch more information, thanks.

  1. If you want to run apm for a Beta channel version of Atom … you should use apm-beta not apm.
  2. You shouldn’t need to set ATOM_RESOURCE_PATH ever really but I had assumed that since you were building a special version of apm that you had built Atom from source as well
  3. It is always best to match versions of built-in Atom components so if you’re building apm from source, you should build Atom from source as well
  4. When building Atom from source, you will need to either clone your Atom source to ~/github/atom or set the ATOM_DEV_RESOURCE_PATH variable to point to your Atom source directory to make things work properly


Above error could be solved with $ set ATOM_ELECTRON_VERSION=1.3.6. But that a new error pops-up, “Could not determine current Atom version installed”.

After noticing a lot of path traversing in the source code, I thought maybe apm needs to be cloned in the vicinity of Atom. So I renamed the apm folder in C:\Users\<user>\AppData\Local\atom\app-1.13.0-beta2\resources\app and cloned apm repo in there. After following the build instructions, I was able to run apm’s commands successfully now.

Still not every test is passing, but more then before.

Edit: lol, same time replied.


@leedohm Thank you for getting back at me.

Can you elaborate on using apm-beta? Is that a command, as I don’t have that command…


Oh right, it doesn’t work that way on Windows. My mistake :head_bandage:

But still, if you’re building apm from source, you should be building Atom from source. Building the latest development version of apm and trying to use it with a stable or even beta version of Atom is going to be far more likely to fail in strange ways.


The bug fix I had in mind is a fairly isolated fix. But I’ll give building Atom a try. Have been wanting to do that for a long time now. Oh my poor laptop.