_From @theoctopod on June 7, 2015 10:34_
Running version 0.207.0 on Windows 8.1.
Everything was running perfectly until I decided to make junction points from C:\Users\<username>\AppData\Local to D:\Users\<username>\AppData\Local, C:\Users\<username>\AppData\LocalLow to D:\Users\<username>\AppData\LocalLow, and C:\Users\<username>\AppData\Roaming to D:\Users\<username>\AppData\Roaming in order to free space on my C drive.
Anyway, ever since doing that, I was unable to search for any packages. The featured packages also fails with a seemingly uninformative error:

Also, viewing my local packages or themes doesn't work, as all the categories are frozen on "Loading packages...":

In the Developer Console, there is an error about failing to fetch local packages:
Fetching local packages failed. Error: Fetching local packages failed.
at D:\Users\<username>\AppData\Local\atom\app-0.207.0\resources\app.asar\node_modules\settings-view\lib\package-manager.js:83:21
at exit (D:\Users\<username>\AppData\Local\atom\app-0.207.0\resources\app.asar\node_modules\settings-view\lib\package-manager.js:53:16)
at triggerExitCallback (D:\Users\<username>\AppData\Local\atom\app-0.207.0\resources\app.asar\src\buffered-process.js:213:47)
at ChildProcess.<anonymous> (D:\Users\<username>\AppData\Local\atom\app-0.207.0\resources\app.asar\src\buffered-process.js:235:18)
at emitTwo (events.js:87:13)
at ChildProcess.emit (events.js:169:7)
at Process.ChildProcess._handle.onexit (child_process.js:1057:12)
I could revert the junction points as a last resort if that's the only way to fix this problem, but I was wondering if anyone could pinpoint the exact cause of this issue.
_Copied from original issue: atom/atom#7153_
Would you mind moving this to https://github.com/atom/settings-view?
Yikes. Sorry you had to move it for me, I couldn't get back fast enough.
Anyway, it's worth noting that the problem still exists on both a clean install of Atom (those screenshots were taken on a clean install) and with Atom's safe mode.
I have the same problem, only I didn't attempt to create junction points. Any update on how this issue can be resolved?
I had the same problem on my work desktop but not my personal laptop or desktop. I started removing programs I had on my work desktop that was not on the other two and tested after each removal and I found that when I removed Cygwin it worked. I think you need to remove all programs which aim to replace cmd.exe
@damieng do you want to take a look at this?
I've just installed the stable version (1.6.2) and found myself with the same error. I haven't made any junction points (though it would be nice if we could choose where Atom installed to!). I opened the dev console and noticed errors. Here's the traceback it produced:
Uncaught (in promise) Error: Fetching local packages failed.
at C:\Users\David\AppData\Local\atom\app-1.6.2\resources\app.asar\node_modules\settings-view\lib\package-manager.js:103:21
at exit (C:\Users\David\AppData\Local\atom\app-1.6.2\resources\app.asar\node_modules\settings-view\lib\package-manager.js:73:16)
at triggerExitCallback (C:\Users\David\AppData\Local\atom\app-1.6.2\resources\app.asar\src\buffered-process.js:213:47)
at ChildProcess.<anonymous> (C:\Users\David\AppData\Local\atom\app-1.6.2\resources\app.asar\src\buffered-process.js:235:18)
at emitTwo (events.js:87:13)
at ChildProcess.emit (events.js:172:7)
at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
I've also included a short video where I tried to play around and cause some of these errors to appear in the console. At the start, I'm able to right click and "open in explorer" despite an error message telling me that atom failed to do so!
Edit: I added a javascript breakpoint at line 200 of internal/child_process.js and looked around at the local variables. The contents of `self' seemed to be releveant---screenshot below.

I think I've got this sorted. The problem seems to be similar to #533, where cmd.exe was attempting to run something via an AutoRun key in the registry. The 'something' triggered an error each time, preventing Atom from accessing apm's output---despite the fact that calling apm ls --json manually worked perfectly.
According to the help (cmd.exe /?), the command prompt looks for the registry keys
HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor\EnableExtensionsHKEY_CURRENT_USER\Software\Microsoft\Command Processor\EnableExtensionsbut neither was present on my machine. I searched for any key called Command Processor and I eventually found
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Command Processor(note the Wow6432Node). Its value was "C:\Program Files (x86)\clink\0.4.4\clink" inject --profile "~\clink". I suppose I hadn't uninstalled clink correctly.
After I deleted this key, I could list and see packages in atom perfectly.
I am able to reproduce this on Windows when opening Atom from GitHub Desktop:

Running Windows 10 and Atom 1.10.2 (latest)
I ran into the same problem...Windows 10, no changes to Atom or using any 3rd party app that replaces my CMD. All I did was Run As Admin for Atom and it resolved my issue, even though it was running fine without having to do that a few days ago. Hope this resolves it for some of you.
This issue is becoming a kind of catch-all for anything resulting in apm not being called correctly from Atom.
What we need I think is some kind of output window in the case of failure where you can see exactly what went on in the console it spawned so we can correctly identify the various issues. Issues we've seen so far are;
I encountered a similar version of this problem with a twist. I get the same error as OP, but not if I start Atom via the start menu entry (which runs C:\Users\Foo\AppData\Local\atom\Update.exe --processStart atom.exe) or via atom in a cmd.exe, the Git Bash or a Cygwin terminal.
Unfortunately, the bug occurs with my most used way of starting Atom: Using the _Open with Atom_ entry in the Windows Explorer context menu. I found an entry in the registry at HKEY_CLASSES_ROOT\*\shell\Atom\command, but it appears to not be the one used, because changing it had no effect for me (I've looked at the command using the ProcessExplorer and changed it to cmd.exe to test if it works). I will see, if it has an effect after the next boot.
However, the command I found for this entry in the registry was "C:\Users\Foo\AppData\Local\atom\app-1.9.9\atom.exe" "%1", which obviously differs from the way the start menu link opens it. Could this cause such an issue?
Other things I've checked so far:
COMSPEC environment variable (https://github.com/atom/atom/issues/7986#issuecomment-123411913)PATH variable for double quotesapm ls --json, which works in cmd.exe and the Git Bash, but fails in Cygwin because of path mush: Error: Cannot find module 'C:\cygdrive\c\Users\Foo\AppData\Local\atom\app-1.11.2\resources\app\apm\lib\cli.js'Uninstalling Cygwin is no option for me, because I'd die of serious brain and nerve damage if I was forced to use a Windows terminal for development.
I'm using Windows 7 64 Bit and the following Atom version:
$ atom --version
Atom : 1.11.2
Electron: 0.37.8
Chrome : 49.0.2623.75
Node : 5.10.0
However, the command I found for this entry in the registry was "C:UsersFooAppDataLocalatomapp-1.9.9atom.exe" "%1", which obviously differs from the way the start menu link opens it. Could this cause such an issue?
Yeah there was an issue with the auto updater and the new System tab in the settings-view causing the registry keys to not get updated correctly. What you should try is:
settings-view with Ctrl+,.@Ben3eeE This solved the issue for me. Thank you very much.
The scenario where spaces were not corrected escaped has been fixed.
The scenario where autoruns were interfering with the output has been fixed.
The scenario with double-escaped PATH has been fixed.
I'm closing this issue - if you are running into something similar please raise a new issue with your details.
Most helpful comment
Yeah there was an issue with the auto updater and the new System tab in the
settings-viewcausing the registry keys to not get updated correctly. What you should try is:settings-viewwith Ctrl+,.