APM not recognizing login, unable to publish


All of a sudden, I’m unable to publish updates to a package because APM is using https and I have 2FA enabled for Github. My steps are:

apm develop fountain
cd ~/github/fountain
apm login  # follow steps, enter token from https://atom.io/account
apm publish patch

Preparing and tagging a new version ✓
Pushing v0.6.3 tag Username for 'https://github.com':  # login via username/pass fails

If I run git remote -v I get:

origin	https://github.com/superlou/fountain-atom (fetch)
origin	https://github.com/superlou/fountain-atom (push)

So, that looks suspicious, as it’s using https. I tried doing a git clone manually instead:

$ git clone git@github.com:superlou/fountain-atom.git
Cloning into 'fountain-atom'...
remote: Counting objects: 427, done.
remote: Compressing objects: 100% (10/10), done.
remote: Total 427 (delta 1), reused 5 (delta 1), pack-reused 415
Receiving objects: 100% (427/427), 2.13 MiB | 0 bytes/s, done.
Resolving deltas: 100% (207/207), done.
Checking connectivity... done.
$ npm install
npm WARN enoent ENOENT: no such file or directory, open '/home/lsimons/github/package.json'
$ git remote -v
origin	git@github.com:superlou/fountain-atom.git (fetch)
origin	git@github.com:superlou/fountain-atom.git (push)
$ apm login
Saving token to Keychain ✓
$ apm publish patch
Preparing and tagging a new version ✓
Pushing v0.6.3 tag Username for 'https://github.com': 

The remote looks better, but I still get a request for username and password. Any ideas for what I can check? This just started happening. In the past, as long as I did an apm login things worked fine.


I had this issue since enabling 2FA.

You must create a Personal access token and use that as your password (username is still whatever your git username is).


@noseglid, that worked! I created a personal access token with the repo scopes. Any idea why this came up now, but was working simply with apm login in the past?


I am not aware of any changes causing this. I just assumed it was because I enabled 2FA.


That’s reasonable. Was just curious since I’ve been using 2FA for a while without needing this solution. Either way, personal access token works.