setting bash editor as vscode throw error node:internal/modules/cjs/loader:990 - visual-studio-code

I am trying to set up visual studio code as default editor on git bash. However, I keep facing the following issue.
node:internal/modules/cjs/loader:990
throw err;
^
Error: Cannot find module 'C:\Users\username\anaconda3\Library\c\Users\username\AppData\Local\Programs\Microsoft VS Code\resources\app\out\cli.js'
at Module._resolveFilename (node:internal/modules/cjs/loader:987:15)
at Module._load (node:internal/modules/cjs/loader:832:27)
at c._load (node:electron/js2c/asar_bundle:5:13343)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
at node:internal/main/run_main_module:17:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
I've tried to reinstall vscode, git and nodejs. But it doesn't help.
Also tried editing the env path to no avail.
The error seems to lie in the module path itself which resolves to duplicated "c\Users\username..."
Appreciate any help here. Thanks!
UPDATE
I manage to dig deeper and found out that it is due to these particular lines of code that is causing the issue.
elif [ -x "$(command -v cygpath)" ]; then <-- THIS LINE
CLI=$(cygpath -m "$VSCODE_PATH/resources/app/out/cli.js")
They can be found in C:\Users\username\AppData\Local\Programs\Microsoft VS Code\bin\code.
Apparently, code is referencing to the cygpath that was installed by anaconda3 and hence ran the if statement. If I comment these 2 lines out to prevent cygpath from running, I am able to open vscode via bash with no issue. However, I don't think this is the long term solution.
Appreciate any advice. Thanks!

Related

"liveSass.command.watchMySass not found" and "Extension host terminated unexpectedly” in vs code on windows 10

Problem
"liveSass.command.watchMySass not found" and "Extension host terminated unexpectedly” in vs code on windows 10 while using live-sass-compiler extension.
Failed attempts:
manually deleted the extension from the .vscode folder and reinstalled it as per #219
[Antivirus/defender] tried excluding the extensionHostProcess.js file at C:\Users\ (user file name e.g- hp...etc) \AppData\Local\Programs\Microsoft VSCode\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js as per #94858
Disabled all extensions and tried running as per #94807
Tried restoring quarantined files from antivirus/defender
Tried all the aforementioned steps again after reinstalling vs code.
downloaded vscode - January 2020 (version 1.42) build as per https://stackoverflow.com/a/61133333/11045279
Error log
c:\Users\ADITYA\.vscode\extensions\ritwickdey.live-sass-3.0.0\node_modules\sasslib\sass.sync.js:61
var Module=typeof Module!=="undefined"?Module:{};var moduleOverrides={};var key;
for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}
Module["arguments"]=[];
Module["thisProgram"]="./this.program";
Module["quit"]=(function(status,toThrow){throw toThrow});Module["preRun"]=[];Module["postRun"]=[];
var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;
var ENVIRONMENT_IS_SHELL=false;
if(Module["ENVIRONMENT"]){if(Module["ENVIRONMENT"]==="WEB"){ENVIRONMENT_IS_WEB=true}
else if(Module["ENVIRONMENT"]==="WORKER"){ENVIRONMENT_IS_WORKER=true}
else if(Module["ENVIRONMENT"]==="NODE"){ENVIRONMENT_IS_NODE=true}
else if(Module["ENVIRONMENT"]==="SHELL"){ENVIRONMENT_IS_SHELL=true}
else{throw new Error("Module['ENVIRONMENT'] value is not valid. must be one
of: WEB|WORKER|NODE|SHELL.")}}else{ENVIRONMENT_IS_WEB=typeof
window==="object";ENVIRONMENT_IS_WORKER=typeof importSc
Error: Import "node_modules/bootstrap/scss/bootstrap" could not be resolved.
at File.load (D:\Projects\vscode-ext-color-highlight\node_modules\file-importer\index.js:130:1)
at D:\Projects\vscode-ext-color-highlight\node_modules\file-importer\index.js:136:1
at FSReqCallback.oncomplete (fs.js:165:21)
abstractExtensionService.ts:155 Extension host terminated unexpectedly. Code: 7 Signal: null
Thanks.
Here's the fix so you don't have the nightmare I've been having.
Uninstall live sass and close VScode.
For Windows, type the following into file explorer:
%USERPROFILE%.vscode\extensions
Then delete the folder for live sass. Should be called something like:
ritwickdey.live-sass-3.0.0
Open VScode, reinstall live sass.
Done
The problem that's not about installation problem, that's need to open VS Code editor and then create new file with SCSS format. For example, style.scss, and please wait for second and then you see watch sass in below of vscode.

openfoam ./makeParaview

i am currently building openfoam 1912 from source and have some trouble building paraview. I just build Qt and Cmake but as soon as i type ./makeParaview qt-5.9.9 5.6.3i get the following error:
./makeParaView: 64: local: -DWM_DP: bad variable name
./makeParaView: 64: ./makeParaView: -DOPENFOAM: bad variable name
A similar error occurs when i try to make VTK / Adios2. Any idea where i took the wrong turn?
Greetings
Gabbagandalf
The proper solution is related to shell quoting issues
- flag="$(stripCompilerFlags $flag)"
+ flag="$(stripCompilerFlags "$flag")"
but in the meantime you can simply change the shebang to #!/bin/bash - it is more forgiving.
As discussed and resolved in these GitLab ticket-1 and ticket-2:
The issue seems to be Ubuntu related.
Solution:
Prior to execute ./makeParaview, switch to bash:
Change the first line of makeParaView script to #!/bin/bash
sudo dpkg-reconfigure dash
./makeParaView

Error with static compilation Qt with postgresql driver

I have installed through Mainteinance Tool Qt 5.12.5 and the sources. I have the next directories:
C:\Qt\5.12.5\Src
C:\Qt\Tools\mingw730_32\
C:\Qt\Tools\mingw730_64\
On the other hand, I have read that downloable Postgres version is compiled with MSVC, and I must to compile my own version. I have do it following link, and now I have a postgresql version in c:\pgsql
Finally I have added c:\pgsql to user Path
Next step, I have opened PowerShell in Admin mode and I´ve gone to C:\Qt\5.12.5\Src\.
Next, set the env path for this PowerShell session:
$env:Path += ";C:\Qt\Tools\mingw730_64\bin\;C:\Qt\5.12.5\Src;C:\pgsql\include\;C:\pgsql\lib\;C:\pgsql\bin\" (setting the pgsql path again....)
After that, I execute configure.bat like that:
configure -v -static -release -static-runtime -platform win32-g++ -prefix C:\Qt\5.12.5\Estatico\ -opensource -confirm-license -qt-zlib -qt-pcre -qt-libpng -qt-libjpeg -qt-freetype -opengl desktop -no-openssl -opensource -confirm-license -skip webengine -make libs -nomake tools -nomake examples -nomake tests -sql-psql
But I have get this error:
ERROR: Feature 'sql-psql' was enabled, but the pre-condition 'libs.psql' failed.
Searching in config.log I can read those lines:
loaded result for library config.qtbase_sqldrivers.libraries.psql
Trying source 0 (type pkgConfig) of library psql ...
pkg-config use disabled globally.
=> source produced no result.
Trying source 1 (type psqlConfig) of library psql ...
pg_config not found.
=> source produced no result.
Trying source 2 (type psqlEnv) of library psql ...
None of [liblibpq.dll.a liblibpq.a libpq.dll.a libpq.a libpq.lib] found in [] and global paths.
=> source produced no result.
Trying source 3 (type psqlEnv) of library psql ...
=> source failed condition '!config.win32'.
test config.qtbase_sqldrivers.libraries.psql FAILED
What can I do or what is the properly way to do that?
Thank you in advance.
UPDATE
There are similar question here but it hasn´t been solved, and those question ask about Visual Studio.
I want to compile it under mingw.
The solution suggested by #Soheil Armin doesn´t work too
The solution suggested by #Soheil Armin works fine, but I need to delete the entire source tree and reinstall it as he suggested. If not, a new configure won't work.
Also, the ^ character can be saved:
configure <your parameters>
PSQL_LIBS="C:\pgsql\lib\libpq.a"
-I "C:\pgsql\include"
-L "C:\pgsql\lib"
You need to explicitly define library paths of Postgres.
configure <your parameters> ^
PSQL_LIBS="C:\pgsql\lib\libpq.a" ^
-I "C:\pgsql\include" ^
-L "C:\pgsql\lib"

Error in Glance_image[cirros] : change from absent to present failed: Command: ... has been running for more then 20 seconds

I am running packstack.
Error: /Stage[main]/Main/Glance_image[cirros]/ensure: change from
absent to pres
ent failed: Command: 'openstack ["image", "create", "--format",
"shell", ["cirros", "--public", "--container-format=bare", "--disk-format=qcow2", "--copy-from=http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-x86_64-disk.img"]]' has been running for more then 20 seconds!
I am having this error, I can wget it though, so I can perfectly reach it. Can someone help me resolving this? As a workaround I tried it manually, but I am really new to centos and Openstack, so I don't know much. I tried :
openstack image create --format shell cirros --public --container-format=bare --disk-format=qcow2 --copy-from=http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-x86_64-disk.img
I got Missing parameter(s):
Set a username with --os-username, OS_USERNAME, or auth.username Set
an authentication URL, with --os-auth-url, OS_AUTH_URL or
auth.auth_url Set a scope, such as a project or domain, set a project
scope with --os-project-
name, OS_PROJECT_NAME or auth.project_name, set a domain scope with
--os-domain-name, OS_DOMAIN_NAME or auth.domain_name
What should I add to the above command? Will it be able to solve my problem? If not what is the right way to solve the problem?
Solved it by replacing
--copy-from=http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-x86_64-disk.img to point --copy-from=<local path>
But didn't got why the original command not working even when I can wget it.

How to import github repos into Atom editor?

In Atom editor, there is an import package that should allow user to import github repos into the Atom, here: https://atom.io/packages/import
I've tried it and it didn't work and gave me this error:
Uncaught TypeError: Cannot read property 'projectHome' of undefined
An issue was also raised but did anyone else have the same problem and know how to resolve this? My system is an Ubuntu 14.04.1
How to import Github repos into Atom editor?
I've tried to remove ~/.atom/config file but it doesn't exist:
alvas#ubi:~/.atom$ ls
compile-cache config.cson nohup.out packages storage
I've tried removing the config.cson and the same error. When i tried to grep for ProjectHome, i got:
alvas#ubi:~/.atom$ grep -nRHI projectHome *
compile-cache/coffee/5047aaae22a3f9ac99b5d85d388d780b7e76a729.js:96: workspace = atom.config.settings.core.projectHome;
compile-cache/coffee/5047aaae22a3f9ac99b5d85d388d780b7e76a729.js:97: defaultWorkspace = atom.config.defaultSettings.core.projectHome;
packages/import/lib/import-view.coffee:41: workspace = atom.config.settings.core.projectHome
packages/import/lib/import-view.coffee:42: defaultWorkspace = atom.config.defaultSettings.core.projectHome
You can try, to see if that make the issue go away, a similar solution like issue 3845:
Hm, the issue disappeared after I'd remove my ~/.atom/config.
I don't remember if I set something there with hands – guess some of local installed package did something :(
You can see a similar error at Atom.project.path (cannot call path of undefined in test), which points out that not every variable are set.