atom / settings-view

🔧 Edit Atom settings
MIT License
273 stars 275 forks source link

Atom package manager can not show any installed modules on Windows in Settings view #924

Open TAXUEZJU opened 7 years ago

TAXUEZJU commented 7 years ago

Description

On latest Windows 10 Home Edition, there is some problem with atom package manager. Nothing can show in Featured Packages in Settings even I has not installed any modules. The error message is "Fetching featured packages failed", and nothing shows after click "Show output". I have turned on Dev window, and find something like "uncaught error" in red. I am sure my network is OK, and atom's version is latest. I have tried to fully uninstall atom and delete all its directory and reinstall it. The problem still exists. I have tried clean install Windows and the problem still not be solved. My atom version and log file's content is below:

C:\Users\TAXUE>atom --version

Atom    : 1.15.0
Electron: 1.3.13
Chrome  : 52.0.2743.82
Node    : 6.5.0

and

task.coffee:84 spell-check:en-us Can't load en_US: Cannot find dictionary for en_US.
package-manager.coffee:149 Uncaught (in promise) Error: Fetching outdated packages and themes failed.
    at C:\Users\TAXUE\AppData\Local\atom\app-1.15.0\resources\app.asar\node_modules\settings-view\lib\package-manager.js:221:21
    at exit (C:\Users\TAXUE\AppData\Local\atom\app-1.15.0\resources\app.asar\node_modules\settings-view\lib\package-manager.js:99:16)
    at triggerExitCallback (C:\Users\TAXUE\AppData\Local\atom\app-1.15.0\resources\app.asar\src\buffered-process.js:322:11)
    at ChildProcess.<anonymous> (C:\Users\TAXUE\AppData\Local\atom\app-1.15.0\resources\app.asar\src\buffered-process.js:352:11)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:191:7)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
package-manager.coffee:85 Uncaught (in promise) Error: Fetching local packages failed.
    at C:\Users\TAXUE\AppData\Local\atom\app-1.15.0\resources\app.asar\node_modules\settings-view\lib\package-manager.js:142:19
    at exit (C:\Users\TAXUE\AppData\Local\atom\app-1.15.0\resources\app.asar\node_modules\settings-view\lib\package-manager.js:99:16)
    at triggerExitCallback (C:\Users\TAXUE\AppData\Local\atom\app-1.15.0\resources\app.asar\src\buffered-process.js:322:11)
    at ChildProcess.<anonymous> (C:\Users\TAXUE\AppData\Local\atom\app-1.15.0\resources\app.asar\src\buffered-process.js:352:11)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:191:7)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
apm
VM795:1 Uncaught ReferenceError: apm is not defined
    at <anonymous>:1:1(anonymous function) @ VM795:1
1

<img width="960" src="https://cloud.githubusercontent.com/assets/10264706/23977666/63e76ab4-0a2a-11e7-9019-d95f7da7ee48.png">

TAXUEZJU commented 7 years ago

Add: I can get nothing after execute "apm" or "apm --version" in "cmd.exe", is there any possbility that apm is not correctly recognized during installation. The problem still exists with the portable version.

rsese commented 7 years ago

Thanks for moving your issue over :v:

Based on your screenshots, it looks like there's some similarity to https://github.com/atom/settings-view/issues/533.

Looking at some of the comments there, can you confirm how you start Atom when you run into this problem? E.g. via the Start Menu or with right-click "Open with > Atom"?

Add: I can get nothing after execute "apm" or "apm --version" in "cmd.exe"

Just to confirm, do you mean the command hangs and doesn't return or it returns and doesn't display anything? Can you share a screenshot of what you see when running apm --version?

TAXUEZJU commented 7 years ago

I have tried all three ways you mentioned, the problem still exists. The command returns without any output. Here is the screenshot. The problem occurs even when clean Windows installation without any third party softwares. I think it may not be caused by other softwares or modifying path. 1

TAXUEZJU commented 7 years ago

It seems accessing apm's output is blocked. There is still no output even executing "apm ls --json" in "cmd.exe". So clicking "show output" in error warning in settings-view just showed blank. What do you think may cause this problem? @rsese

50Wliu commented 7 years ago

What is the output of where apm?

TAXUEZJU commented 7 years ago
C:\Users\TAXUE>where apm
C:\Users\TAXUE\AppData\Local\atom\bin\apm
C:\Users\TAXUE\AppData\Local\atom\bin\apm.cmd

@50Wliu

damieng commented 7 years ago

Please try the following to help diagnose the issue and let us know the results.

type C:\Users\TAXUE\AppData\Local\atom\bin\apm.cmd
cd "c:\users\taxue\appdata\local\atom x64\app-1.15.0\resources\app\apm"
dir
bin\apm --version
TAXUEZJU commented 7 years ago

Thanks for reply. @damieng

C:\Users\TAXUE\AppData\Local\atom\bin>apm.cmd

C:\Users\TAXUE\AppData\Local\atom\bin>

There is no directory named "atom x64" in the path you mentioned.

C:\Users\TAXUE\AppData\Local\atom\app-1.15.0\resources\app\apm>dir
 驱动器 C 中的卷没有标签。
 卷的序列号是 72F3-7112

 C:\Users\TAXUE\AppData\Local\atom\app-1.15.0\resources\app\apm 的目录

2017/03/16  14:37    <DIR>          .
2017/03/16  14:37    <DIR>          ..
2017/03/16  14:36    <DIR>          bin
2017/03/16  14:36                 7 BUNDLED_NODE_VERSION
2017/03/16  14:36                92 CONTRIBUTING.md
2017/03/16  14:36            38,921 deprecated-packages.json
2017/03/16  14:36             1,669 ISSUE_TEMPLATE.md
2017/03/16  14:36    <DIR>          lib
2017/03/16  14:36             1,055 LICENSE.md
2017/03/16  14:36    <DIR>          native-module
2017/03/16  14:36           310,304 node.exe
2017/03/16  14:37    <DIR>          node_modules
2017/03/16  14:36             4,426 package.json
2017/03/16  14:36             1,058 PULL_REQUEST_TEMPLATE.md
2017/03/16  14:36             3,225 README.md
2017/03/16  14:37    <DIR>          script
2017/03/16  14:37    <DIR>          src
2017/03/16  14:37    <DIR>          templates
               9 个文件        360,757 字节
               9 个目录 86,049,062,912 可用字节

C:\Users\TAXUE\AppData\Local\atom\app-1.15.0\resources\app\apm>bin\apm --version

C:\Users\TAXUE\AppData\Local\atom\app-1.15.0\resources\app\apm>

Still no output after executing "apm".

damieng commented 7 years ago

Can you open the file C:\Users\TAXUE\AppData\Local\atom\app-1.15.0\resources\app\apm\bin\apm.cmd in Atom and paste the contents here?

Also if the first line is @echo off can you change it to rem @echo off and then type;

C:\Users\TAXUE\AppData\Local\atom\app-1.15.0\resources\app\apm\bin\apm.cmd and paste the output.

Sorry that you're having this trouble - this is very unusual.

TAXUEZJU commented 7 years ago
C:\Users\TAXUE>rem @echo off

C:\Users\TAXUE>C:\Users\TAXUE\AppData\Local\atom\app-1.15.0\resources\app\apm\bin\apm.cmd

C:\Users\TAXUE>

Still no output. Contents of apm.cmd

@echo off
setlocal enabledelayedexpansion

:: Try to find git.exe in path
for /f "tokens=*" %%G in ('where git 2^>nul') do set "apm_git_path=%%~dpG"
if not defined apm_git_path (
  :: Try to find git.exe in GitHub Desktop, oldest first so we end with newest
  for /f "tokens=*" %%d in ('dir /b /s /a:d /od "%LOCALAPPDATA%\GitHub\PortableGit*" 2^>nul') do (
    if exist "%%d\cmd\git.exe" set "apm_git_path=%%d\cmd"
  )
  :: Found one, add it to the path
  if defined apm_git_path set "Path=!apm_git_path!;!PATH!"
)

set "maybe_node_gyp_path=%~dp0\..\node_modules\node-gyp\bin\node-gyp.js"
if exist "%maybe_node_gyp_path%" (
  set "npm_config_node_gyp=%maybe_node_gyp_path%"
)

if exist "%~dp0\node.exe" (
  "%~dp0\node.exe" "%~dp0/../lib/cli.js" %*
) else (
  node.exe "%~dp0/../lib/cli.js" %*
)

I have tried to modify first line with rem @echo off in "apm.cmd", and output after executing C:\Users\TAXUE\AppData\Local\atom\app-1.15.0\resources\app\apm\bin\apm.cmd shows below.

C:\Users\TAXUE>C:\Users\TAXUE\AppData\Local\atom\app-1.15.0\resources\app\apm\bin\apm.cmd

C:\Users\TAXUE>rem @echo off

C:\Users\TAXUE>setlocal enabledelayedexpansion

C:\Users\TAXUE>for /F "tokens=*" %G in ('where git 2>nul') do set "apm_git_path=%~dpG"

C:\Users\TAXUE>if not defined apm_git_path (
for /F "tokens=*" %d in ('dir /b /s /a:d /od "C:\Users\TAXUE\AppData\Local\GitHub\PortableGit*" 2>nul') do (if exist "%d\cmd\git.exe" set "apm_git_path=%d\cmd" )
 if defined apm_git_path set "Path=!apm_git_path!;!PATH!"
)

C:\Users\TAXUE>set "maybe_node_gyp_path=C:\Users\TAXUE\AppData\Local\atom\app-1.15.0\resources\app\apm\bin\\..\node_modules\node-gyp\bin\node-gyp.js"

C:\Users\TAXUE>if exist "C:\Users\TAXUE\AppData\Local\atom\app-1.15.0\resources\app\apm\bin\\..\node_modules\node-gyp\bin\node-gyp.js" (set "npm_config_node_gyp=C:\Users\TAXUE\AppData\Local\atom\app-1.15.0\resources\app\apm\bin\\..\node_modules\node-gyp\bin\node-gyp.js" )

C:\Users\TAXUE>if exist "C:\Users\TAXUE\AppData\Local\atom\app-1.15.0\resources\app\apm\bin\\node.exe" ("C:\Users\TAXUE\AppData\Local\atom\app-1.15.0\resources\app\apm\bin\\node.exe" "C:\Users\TAXUE\AppData\Local\atom\app-1.15.0\resources\app\apm\bin\/../lib/cli.js"  )  else (node.exe "C:\Users\TAXUE\AppData\Local\atom\app-1.15.0\resources\app\apm\bin\/../lib/cli.js"  )

And still no output after executing "apm". Thanks for your reply. @damieng

damieng commented 7 years ago

Basically it's supposed to be running the node.exe against a JS file. I've never seen it silently fail before. Try this;

cd C:\Users\TAXUE\AppData\Local\atom\app-1.15.0\resources\app\apm\bin
.\node.exe --version
.\node.exe ..\lib\cli.js
TAXUEZJU commented 7 years ago
C:\Users\TAXUE>cd C:\Users\TAXUE\AppData\Local\atom\app-1.15.0\resources\app\apm\bin

C:\Users\TAXUE\AppData\Local\atom\app-1.15.0\resources\app\apm\bin>.\node.exe --version
v4.4.5

C:\Users\TAXUE\AppData\Local\atom\app-1.15.0\resources\app\apm\bin>.\node.exe ..\lib\cli.js

C:\Users\TAXUE\AppData\Local\atom\app-1.15.0\resources\app\apm\bin>
TAXUEZJU commented 7 years ago

What kind of problem do you think it will be? @damieng

damieng commented 7 years ago

I'm at a loss. Basically node when running this code is just silently exiting. I've never seen a report of that before despite the huge number of Atom users.

You could try checking to see if you have a .apmrc file in your .atom home folder (%userprofile%\.atom) and try removing that - perhaps it is having a problem parsing it.

TAXUEZJU commented 7 years ago

It seems there is no file named ".apmrc" in the folder.

C:\Users\TAXUE\.atom>dir
 驱动器 C 中的卷没有标签。
 卷的序列号是 72F3-7112

 C:\Users\TAXUE\.atom 的目录

2017/03/20  11:07    <DIR>          .
2017/03/20  11:07    <DIR>          ..
2017/03/15  15:33                57 .gitignore
2017/03/23  21:11    <DIR>          blob-store
2017/03/15  15:33    <DIR>          compile-cache
2017/03/20  10:18               297 config.cson
2017/03/15  15:33               386 init.coffee
2017/03/15  15:33             1,318 keymap.cson
2017/03/15  15:33    <DIR>          packages
2017/03/23  15:40    <DIR>          recovery
2017/03/15  15:33               710 snippets.cson
2017/03/15  15:33    <DIR>          storage
2017/03/15  15:33               712 styles.less
               6 个文件          3,480 字节
               7 个目录 89,003,749,376 可用字节

C:\Users\TAXUE\.atom>
50Wliu commented 7 years ago

Can you make sure that C:\Users\TAXUE\AppData\Local\atom\app-1.15.0\resources\app\apm\lib\cli.js is non-empty?

I just did node test.js, where test.js was a 0-byte file, and Node returned with no output.

TAXUEZJU commented 7 years ago

Here is the content of the file "cli.js".

(function() {
  var apm;

  apm = require('./apm-cli');

  process.title = 'apm';

  apm.run(process.argv.slice(2), function(error) {
    return process.exitCode = error != null ? 1 : 0;
  });

}).call(this);
TAXUEZJU commented 7 years ago

The problem is very strange. On my second laptop, atom works well even after I reinstall Windows 10. But on this laptop, it doesn't work well. The problem should be nothing to do with the hardware. I am confused.

TAXUEZJU commented 7 years ago

Maybe this problem is likely to be related to hardware? I reinstall Windows 10 Pro on my laptop and the problem still exists. The system version is Windows 10 Home before. So it is nothing to do with Windows. On My other devices, atom works well regardless of system version. One is i5-3210m and the other is z8550. However, things go wrong on this device which is n4200. So maybe it is related to drivers with n4200. Is there any possibility that the compiled program like node.exe can not correctly run on a particular platform? The problem only exists on this device. @rsese @damieng @50Wliu

damieng commented 7 years ago

I wouldn't have thought it's node or drivers but I'm not sure there's much more diagnosis we can do without being able to reproduce the problem ourselves. Given the lack of others reporting the issue it's probably something very specific on this system.

TAXUEZJU commented 7 years ago

Will remote assistance be helpful? I do not know how to debug it. Maybe you will get more diagnosis information if you can access my device.

rsese commented 7 years ago

Sorry, remote debugging for an issue that looks system specific is beyond the help we can provide. If there was a reproducible problem like @damieng mentioned, then that's something we could investigate without the need for remote debugging.

TAXUEZJU commented 7 years ago

The problem seems a little different after upgrading atom to 1.16.0. The output is not null any more. I will paste new error message below.

Fetching featured packages failed.Hide output…
write EPROTO 101057795:error:140943F2:SSL routines:ssl3_read_bytes:sslv3 alert unexpected message:openssl\ssl\s3_pkt.c:1493:SSL alert number 10
101057795:error:1409E0E5:SSL routines:ssl3_write_bytes:ssl handshake failure:openssl\ssl\s3_pkt.c:659:
damieng commented 7 years ago

It sounds then like a connection issue - is your machine behind a proxy server, firewall or corporate network?

TAXUEZJU commented 7 years ago

I use shadowsocks but the problem remains same after I turn it off. I also allow "node.exe" in Windows Firewall and executed "apm config set strict-ssl false" in powershell in reference to similar issue. By the way, apm works correctly now.

damieng commented 7 years ago

I'm confused. You say the problem remains but it works correctly now...

TAXUEZJU commented 7 years ago

I mean executing apm in powershell just has output messages now while it always returned null before. And installed packages show correctly in atom. But featured packages still can not show. default

damieng commented 7 years ago

Based on the SSL error message I'd say your sockets/proxy is attempting to do something unusual with the SSL connection. I don't think we are going to be able to provide any additional help in such a scenario.

praneethmendu commented 6 years ago

hey, have the same issue, what cpu does this laptop have, maybe related to this : https://github.com/nodejs/node/issues/12691 mine is a celeron N3350

TAXUEZJU commented 6 years ago

Mine is N4200. @praneethmendu

praneethmendu commented 6 years ago

@TAXUEZJU I got it working by using 32 bit version. That is worse than hacky I agree but I needed some solution now.

0x746f6d commented 6 years ago

i had the same problem. i have a celeron n3450 cpu.

i always got this error message:

write EPROTO 101057795:error:140943F2:SSL routines:ssl3_read_bytes:sslv3 alert unexpected message:openssl\ssl\s3_pkt.c:1493:SSL alert number 10
101057795:error:1409E0E5:SSL routines:ssl3_write_bytes:ssl handshake failure:openssl\ssl\s3_pkt.c:659:

i experimented a lot but the only way to get it working was to use the 32bit version like praneethmendu suggested.

damieng commented 6 years ago

There was an issue in a code path in openssl that was wrong for these processors. It was unfortunately adopted by node and subsequently comes in to Electron and finally to Atom.

Unfortunately they have chosen only to apply the fixes to LTS versions of node - 8,6 and 4. We are currently using a version of Electron that ships with Node 7.

Until we move to at least Electron 1.8.1 running 32-bit version is going to be the only workaround. That might take some time.

ongco commented 6 years ago

I also have this same error message when install the Atom x64 1.23.3 release, with cpu Pentium N4200. Looks like the problem is not yet resolved after almost a year. Thanks for the info.

damieng commented 6 years ago

Yes, unfortunately you'll need to use the 32-bit version of Atom until Atom ships with Electron 1.8.

baybal commented 6 years ago

@damieng any chance Atom adopts a backported SSL fix for its bundled in version of Electron?

damieng commented 6 years ago

Unfortunately as described above the fix was only made to node versions 8, 6 and 4. Electron 1.7 uses node 7 and upgrading the version of node in Electron is often a major undertaking which is why it was adopted in Electron 1.8.

The Atom team is working towards 1.8 but in the mean time using the 32-bit version of Atom should work just fine and there are no 64-bit only features you would miss out on.

overcatbe commented 6 years ago

Me here on celeron n3550. Using the 32 bit version is just a fine solution. Just marking this to get updates when ill be able to finally use the 64 bit version.

jasonrudolph commented 6 years ago

Unfortunately as described above the fix was only made to node versions 8, 6 and 4. Electron 1.7 uses node 7....

We anticipate that Atom 1.28 will include an upgrade to Electron 2.0, which uses Node 8, so that will likely resolve this issue. (Note that the current version of Atom is 1.26, but we anticipate releasing Atom 1.28 this summer.)

JulianHa commented 5 years ago

Hey, running on Atom 1.28.2 here and the problem still persists.

Running on a celeron N4200 here, same exact error code, same exact problem. I really don't wanna switch over to another editor, but also really don't wanna use the 32-bit version of Atom.

Has someone maybe found a manual patch in the meantime? Would appreciate any answer, seeing as this thread is already a few months old.

damieng commented 5 years ago

This is still happening because the apm command line tool hasn't yet upgraded to a newer version of node.

What you might be able to do is just replace the node.exe in your %LocalAppData%\Atom x64\app-dev\resources\app\apm\bin folder with the 32-bit version of node.

Atom itself will still be 64-bit with the added performance increases and large file size support that comes with while the apm command line just used for package updates/install will use the 32-bit version to avoid the bug in the 64-bit OpenSSL on Celerons.

Just make sure the version of node.exe matches - i.e. 6.9.5 for Atom 1.28.2