Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

apm --version doesn't work in git bash on Windows #846

Open
1 task done
kaiyoma opened this issue May 12, 2019 · 6 comments
Open
1 task done

apm --version doesn't work in git bash on Windows #846

kaiyoma opened this issue May 12, 2019 · 6 comments

Comments

@kaiyoma
Copy link

kaiyoma commented May 12, 2019

Prerequisites

Description

apm --version doesn't work in git bash on Windows.

Steps to Reproduce

  1. Run apm --version in the git bash shell.

Expected behavior: [What you expect to happen]
It should work.

Actual behavior: [What actually happens]

$ apm --version
internal/child_process.js:323
    throw errnoException(err, 'spawn');
    ^

Error: spawn UNKNOWN
    at _errnoException (util.js:1024:11)
    at ChildProcess.spawn (internal/child_process.js:323:11)
    at exports.spawn (child_process.js:502:9)
    at EventEmitter.<anonymous> (...\AppData\Local\atom\app-1.36.1\resources\app\apm\lib\apm-cli.js:169:17)
    at _combinedTickCallback (internal/process/next_tick.js:131:7)
    at process._tickCallback (internal/process/next_tick.js:180:9)

Reproduces how often: [What percentage of the time does it reproduce?]
100%

Versions

OS: Windows 10

$ atom --version

Atom    : 1.36.1
Electron: 2.0.18
Chrome  : 61.0.3163.100
Node    : 8.9.3

Additional Information

The command works correctly from the normal command prompt and from PowerShell:

C:\>apm --version
apm  2.1.3
npm  6.2.0
node 8.9.3 x64
atom 1.36.1
python 2.7.15
git 2.19.1.windows.1
visual studio 2015
@50Wliu
Copy link
Contributor

50Wliu commented May 12, 2019

Can you run the following in Git Bash:

node -e "const child_process = require('child_process');console.log(child_process.spawnSync('python', ['--version']).stdout.toString())"

(and if that returns nothing, try replacing stdout with stderr)

@kaiyoma
Copy link
Author

kaiyoma commented May 13, 2019

stdout doesn't show anything, but stderr does:

$ node -e "const child_process = require('child_process');console.log(child_process.spawnSync('python', ['--version']).stderr.toString())"
Python 2.7.15

@50Wliu
Copy link
Contributor

50Wliu commented May 13, 2019

Cool, that's also what happened to me. I'll think about how to debug this further...

@rsese
Copy link

rsese commented May 13, 2019

I had tentatively closed #822 as a duplicate of #725 a while ago but maybe looking at it again, maybe it's better to have this separate issue for Git Bash here @50Wliu? The original report in #725 was about Cygwin and the error looks different....

@50Wliu
Copy link
Contributor

50Wliu commented May 14, 2019

The two are probably related...might be best to keep this one open, though.

@Magia19
Copy link

Magia19 commented Jul 30, 2020

C:\Users\M4G14_SCR!PT>apm -version
internal/modules/cjs/loader.js:983
throw err;
^

Error: Cannot find module 'C:\Users\M4G14_SCRPT\AppData\Local\atom\app-1.44.0\resources\app\apm\lib\cli.js'
�[90m at Function.Module._resolveFilename (internal/modules/cjs/loader.js:980:15)�[39m
�[90m at Function.Module._load (internal/modules/cjs/loader.js:862:27)�[39m
�[90m at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12)�[39m
�[90m at internal/main/run_main_module.js:18:47�[39m {
code: �[32m'MODULE_NOT_FOUND'�[39m,
requireStack: []
}C:\Users\M4G14_SCR!PT>apm -version
internal/modules/cjs/loader.js:983
throw err;
^

Error: Cannot find module 'C:\Users\M4G14_SCRPT\AppData\Local\atom\app-1.44.0\resources\app\apm\lib\cli.js'
�[90m at Function.Module._resolveFilename (internal/modules/cjs/loader.js:980:15)�[39m
�[90m at Function.Module._load (internal/modules/cjs/loader.js:862:27)�[39m
�[90m at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12)�[39m
�[90m at internal/main/run_main_module.js:18:47�[39m {
code: �[32m'MODULE_NOT_FOUND'�[39m,
requireStack: []
}###

My Problem Too

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants