Open haherhohu opened 4 months ago
This bug also affects me. My workaround is to add this to .bashrc after the conda initialization:
export PATH="/usr/bin:$PATH"
To help others find this thread, here is the error in text form:
node:internal/modules/cjs/loader:1155
throw err;
^
Error: Cannot find module 'C:\Users\User\anaconda3\Library\c\Users\User\AppData\Local\Programs\Microsoft VS Code\resources\app\out\cli.js'
at Module._resolveFilename (node:internal/modules/cjs/loader:1152:15)
at Module._load (node:internal/modules/cjs/loader:993:27)
at c._load (node:electron/js2c/node_init:2:13801)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:189:12)
at node:internal/main/run_main_module:28:49 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
Checklist
Impacted product
What happened?
Type: Bug
Running Git Bash in Windows, (base) conda environment is active. Command
code .
returns the same error in vscode repository #187392, #191133It seems to be a bug in
cygpath
in Anaconda.For some reason, the module search is appending "C:\ProgramData\Anaconda3\Library" to the beginning of the correct search path. I checked the vscode execution file (%USERPROFILE%\AppData\Local\Programs\Microsoft VS Code\bin\code) and found the $CLI value has changed when
conda activate
/deactivate
status.When conda is activated, cygpath -m “$VSCODE_PATH” will return “C:/ProgramData/anaconda3/Library” added. When conda is deactivated, cygpath -m “$VSCODE_PATH” will return normally.
Additionally, Anaconda activation adds environment variables to $PATH on first: Conda activation will add these Conda environment variables to the front of $PATH.
The path calculation error is raised when "/c/ProgramData/anaconda3/Library/usr/bin" is added to $PATH before "/usr/bin/", where Git Bash is provided. It replaced cygwin tools provided by Git Bash. I checked these tools versions, but Anaconda has too old a version of these tools.
e.g, cygpath version is
(git-bash, contains in git for windows 2.45.2)
(anaconda /usr/bin, anaconda 2024.02-1)
I suggest updating these old tools for better performance on Windows users.
Expected behavior or outcome
It will raise environment crash with Anaconda and Git Bash on Windows system.
When conda is activated, cygpath -m “$VSCODE_PATH” will return “C:/ProgramData/anaconda3/Library” added. When conda is deactivated, cygpath -m “$VSCODE_PATH” will return normally.
Git Bash is useful terminal on windows users. And vscode is popular editor for developers. And also Anaconda is a base for researchers.
I'm using vscode-anaconda-git(bash) environment many years. I hope to solve these problem. please.
Conda info
Conda config
Conda list
Additional information
No response