The terminal process failed to launch: A native exception occurred during launch (File not found: ) - visual-studio-code

I keep using vscode debug for long time. But it began to fails to use debug from yesterday.
It reports that The terminal process failed to launch: A native exception occurred during launch (File not found: ).
I can use powershell in terminal.
I have tried solution in (https://code.visualstudio.com/docs/supporting/troubleshoot-terminal-launch), but none of them works.
Code -version: 1.47.3
Operating System version: windows 10 1909 build 18363.959
all extensions:
albert.TabOut
christian-kohler.path-intellisense
CoenraadS.bracket-pair-colorizer-2
Equinusocio.vsc-community-material-theme
Equinusocio.vsc-material-theme
equinusocio.vsc-material-theme-icons
eryouhao.brackets-light-pro
formulahendry.code-runner
formulahendry.terminal
Gruntfuggly.todo-tree
HookyQR.beautify
James-Yu.latex-workshop
kisstkondoros.vscode-gutter-preview
manasxx.background-cover
marlosirapuan.nord-deep
MS-CEINTL.vscode-language-pack-zh-hans
ms-python.python
ms-python.vscode-pylance
ms-vscode.cpptools
naumovs.color-highlight
niudai.vscode-zhihu
nnthink.aixcoder
redhat.java
skacekachna.win-opacity
sldobri.nord-5-stars
TabNine.tabnine-vscode
VisualStudioExptTeam.vscodeintellicode
vscjava.vscode-java-debug
vscjava.vscode-java-dependency
vscjava.vscode-java-pack
vscjava.vscode-java-test
vscjava.vscode-maven
vscode-icons-team.vscode-icons
wix.vscode-import-cost
yzhang.markdown-all-in-one
zhuangtongfa.material-theme
setting.json:
"terminal.integrated.shell.windows": "C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\powershell.exe"

In my case this problem arising after updating VS Code version to 1.54.3 on Ubuntu 18.04.
This problem is resolved by restarting VS Code after the update.

Yep, that's kinda what my problem was...PS had been blocked at a system-admin level.
Make sure that you can actually run PS from the command-line or start window.
Win10 popup

I fixed it by change "terminal.integrated.inheritEnv" to false in setting.json.

I also had the same issue and asked the question one week before yet didn't get solution.
here is link of my question
[link]Visual Studio (VS-code) code terminal is failed to launch
1 solution i got:
the issue arises when you delete some of it's files before by mistake and you don't know try to remember that or simply recover your pc to 3 weeks ago atleat so all files will be placed suitably.

I had the error. To fix it, I looked at all the terminal settings in VSCode and checked out the ones that weren't set to the default value. Eventually, I found that the path to my PowerShell had changed to the preview version I had installed. Reverting this to its default got it working again. Hope this helps someone.

Related

Flutter simply showing 'sysctl -n hw.optional.arm64' returned unexpected output: ''

Not sure which details are relevant so I'll include as many as possible.
Had to upgrade flutter today and instead of working when I typed in 'flutter upgrade' into android studios terminal/Iterm2/terminal zsh I was met with the following response.
'sysctl -n hw.optional.arm64' returned unexpected output: ''
When I search for this issue the only thing i can find is this post which states that sysctl can't be found. The path does appear to be in my .zshrc but still not working. I can't use which or where sysctl as it just says 'sysctl not found'
When I try to upgrade flutter through brew (brew install --cask flutter) it downloads fine but on installing it throws the following error:
==> Purging files for version 3.3.5 of Cask flutter
Error: It seems there is already a Binary at '/opt/homebrew/bin/dart'.
I can't continue working as I need the new flutter version and it seems the web doesn't have much to show for this particular error.
I can't flutter --version, flutter doctor or anything of the sort as I just get the same message.
I'm using:
MacOS monterey 12.6 macbook air.
Android studios
Iterm2
Ohmyzsh
When I open android studios it shows me the following:
"Flutter device daemon #1 exited (exit code 1), stderr: 'sysctl -n hw.optional.arm64' returned unexpected output: '' in a pop up window.
Pubspec has been edited > get dependencies > Upgrade depenedencies: Both of which have the same error as in the title.
The current configured flutter SDK is not known to be fully supported. Please update your SDK and restart intelliJ which I think is what I've been trying to do.
This is an answer I hope will be helpful for others who have the same issue.
Other answers suggested a fix by just updating the path document (.zshrc) but this is what helped me as that did not and my paths were up to date.
Sadly, it's as simple as manually deleting all my flutter SDK files locally. Downloading them again (this time the latest one) and unzipping it into the same place. Didn't even have to update the path).
Worked a charm, issues appear to be all gone except that the dialogue in android studios is still saying that there are dependencies that need getting and upgrading (but doesn't go away even when I've run it).
I solved it by removing the old flutter SDK, downloading the latest version, and setting it up again.
it works perfectly for me!

Jupyter extension for VSCode on Linux throws error when doing anything Jupyter related

After installing code-oss on Manjaro Linux along with the Jupyter extension for code and jupyter-notebooks itself, the extension seems to error when I try to do anything Jupyter related inside code. If I try to create a new notebook from the command pallete, it pops up a dialog saying this:
Command 'Jupyter: Create New Jupyter Notebook' resulted in an error (command 'jupyter.createnewnotebook' not found)
Code then tells me that the extension activation failed and to open the chrome developer console for more information. This is what the chrome console then says:
extension activation failed Error: Extension 'ms-toolsai.jupyter' CANNOT use API proposal: notebookEditor. Its package.json#enabledApiProposals-property declares: but NOT notebookEditor. The missing proposal MUST be added and you must start in extension development mode or use the following command line switch: --enable-proposed-api ms-toolsai.jupyter
Initial Pop-up error
Chrome Console error
You can solve that problem by inserting"enable-proposed-api": ["ms-toolsai.jupyter"] in the start settings of vs code. So press CTRL+ALT+P -> "Preference: Configure Runtime Arguments" then insert the upper line. After that restart vscode.
Had the same problem and found out this is happening because of the open source version of code - OSS. It does not have the proper config in the product.json.
The accepted solution to add to Runtime Arguments unfortunately didn't work on Arch.
Easiest solution for me was to install code-features from AUR.
You can find more info on arch wiki site
Or directly on microsoft docs regarding oss code issues.
The solution to add "enable-proposed-api": ["ms-toolsai.jupyter"] to the runtime of vscode didn't work for me on Arch linux. But when I started vscode from the command line using the argument "--enable-proposed-api ms-toolsai.jupyter" the problem was solved. So I created a custom desktop launcher for this:
Fist, copy the desktop launcher to your applications folder
$ cp /usr/share/applications/code-oss.desktop ~/.local/share/applications/.
Then edit the new file:
$ nano ~/.local/share/applications/code-oss.desktop
Now add "--enable-proposed-api ms-toolsai.jupyter" to both of the Exec lines like so:
[Desktop Entry]
Name=Code - OSS
Comment=Code Editing. Redefined.
GenericName=Text Editor
Exec=/usr/bin/code-oss --enable-proposed-api ms-toolsai.jupyter --unity-launch %F
Icon=com.visualstudio.code.oss
Type=Application
StartupNotify=false
StartupWMClass=Code
Categories=TextEditor;Development;IDE;
MimeType=text/plain;application/x-code-oss-workspace;
Actions=new-empty-window;
Keywords=vscode;
[Desktop Action new-empty-window]
Name=New Empty Window
Exec=/usr/bin/code-oss --enable-proposed-api ms-toolsai.jupyter --new-window %F
Icon=com.visualstudio.code.oss
I restarted my computer and the problem was solved.

Not able to launch chrome in protractor

While launching conf.js file in protractor its giving below error :
ERROR [OsProcess.checkForError] - org.apache.commons.exec.ExecuteException: Execution failed (Exit value: -559038737. Caused by java.io.IOException: Cannot run program "/usr/local/lib/node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_87.0.4280.88" (in directory "."): error=86, Bad CPU type in executable)
https://github.com/angular/webdriver-manager/issues/476
Fix will be available soon this weekend. but you will get a workaround by doing this.
As I badly needed to get unblocked - here is a hacky workaround for anyone in similar situation (only for x86_64 macOS). In node_modules/webdriver-manager/built/lib/files/file_manager.js update fileUrl.url around 166:
add below line
fileUrl.url = fileUrl.url.replace(/_m1/, '')
Was facing the similar issue in MacOs Catalina.
This is how it got resolved for me with below versions :
Option 1 :
Download these :
https://chromedriver.storage.googleapis.com/71.0.3578.33/chromedriver_mac64.zip
https://selenium-release.storage.googleapis.com/3.14/selenium-server-standalone-3.14.0.jar
And made the Selenium server UP with this :
java -Dwebdriver.chrome.driver=./chromedriver_71.0.3578.33 -jar ./selenium-server-standalone-3.141.59.jar -port 4444
Option 2 :
Protractor :
Use the below versions :
webdriver-manager update --versions.chrome=71.0.3578.33
webdriver-manager --versions.chrome=71.0.3578.33 start
Got an Error
"Timed out waiting for driver server to start." After running
webdriver-manager update
Resolved it by downgrading to the previous version of webdriver that was working for you.
Steps:
navigate to node_modules/protractor/node_modules/webdriver-manager/selenium/
check if you can see the last chromedriver that you were using before the update
for my case this is chromedriver_86.0.4240.22
since I still have my previous chromedriver, I just Deleted
chromedriver_87.0.4280.88
chromedriver_87.0.4280.88.zip
in node_modules/protractor/node_modules/webdriver-manager/selenium/update-config.json
I changed all instances of chromedriver_87.0.4280.88 and replaced with chromedriver_86.0.4240.22
Run your tests.
Incase you dont know what was the last version that worked for you, you can try
webdriver-manager update --versions.chrome=86.0.4240.22
or look for a version here
This is what worked for me:
Update the protractor version to current stable version: "protractor": "^7.0.0", npm install was the way to go for me, yours will be similar
Update the webdriver: webdriver-manager update with or without sudo is the right command as stated in other answers
Run the webdriver manager with the current chrome version, this is the command that I use for application: webdriver-manager start --versions.chrome=88.0.4324.96 as my chrome is currently at that version, replace it with your chrome's version (87.0.4280.88 as per the question)

New VSCode extension can't find vscode

Why does a new VSCode extension created with yeoman generator immediately not find vscode when starting debug?
Clean install of node, yeoman, and generator "code".
While I can continue to debug with this error, why isn't vscode found? Is it extraneous if debugging actually works?
Type Ctrl+` to get the console and then npm i whereupon you will get a message similar to this
Detected VS Code engine version: ^1.31.0 Found minimal version that
qualifies engine range: 1.31.0 Fetching vscode.d.ts from:
https://raw.githubusercontent.com/Microsoft/vscode/7c66f58312b48ed8ca4e387ebd9ffe9605332caa/src/vs/vscode.d.ts
vscode.d.ts successfully installed!
After that things should be hunky dory.

"ERROR : No emulator images (avds) found" running ionic on osx 10.10

This is the full error message I got after running ionic emulate android
*running cordova emulate android
Running command: /Users/DeadLift/Documents/ionic/myApp/hooks/after_prepare/010_add_platform_class.js /Users/DeadLift/Documents/ionic/myApp
add to body class: platform-android
Running command: /Users/DeadLift/Documents/ionic/myApp/platforms/android/cordova/run --emulator
ANDROID_HOME=/usr/local/Cellar/android-sdk/24.1.2
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home
/Users/DeadLift/Documents/ionic/myApp/platforms/android/cordova /node_modules/q/q.js:126
throw e;
^
ERROR : No emulator images (avds) found.
1. Download desired System Image by running: /usr/local/Cellar/android-sdk/24.1.2/bin/android sdk
2. Create an AVD by running: /usr/local/Cellar/android-sdk/24.1.2/bin/android avd
HINT: For a faster emulator, use an Intel System Image and install the HAXM device driver
Error: /Users/DeadLift/Documents/ionic/myApp/platforms/android/cordova/run: Command failed with exit code 1
at ChildProcess.whenDone (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:131:23) *emphasized text*
at ChildProcess.emit (events.js:110:17)
at maybeClose (child_process.js:1015:16)
at Process.ChildProcess._handle.onexit (child_process.js:1087:5)*
I follow all the above by creating an avd and it give me the same message again.
Thanks.
Vikas's answer is pretty spot on, however (sometimes) just running android avd won't work, which is what I found out after hours of trying to get it working.
When ever I ran android avd in my terminal it would give me the following error:
zsh: command not found: android
This is because I needed to add the Android SDK paths for the platform-tools and tools to my zshrc file (you might be running bash or something else on your terminal).
Simple fix was to add these files to my zshrc PATH environment, You can do this too by using your favourite text editor and depending on what shell you're using.
This link: http://docs.phonegap.com/en/2.8.0/guide_getting-started_android_index.md.html#Getting%20Started%20with%20Android helped me out a hell of a lot getting this fixed.
So I used subl ~/.zshrc (because sublime is my text editor and i've setup symlinks)
I Found my exports PATH and changed it to represent the following:
export PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/dev/.rbenv/versions/2.2.3/bin/ruby:/Users/dev/Library/Android/sdk/platform-tools:/Users/dev/Library/Android/sdk/tools:$PATH"
I then saved the file, closed down sublime and ran source ~/.zshrc in my terminal window, and now I can run android avd and it now opens the Android Virtual Device Manager with no problems.
A reminder your shell might be different to mine (i.e. not running with zsh)and your exports PATH might look different as well, but it's pretty easy to figure out, and the link above will also help if you get stuck.
Actually it is not able to find AVD (Android virtual device). You have to create one.
Type "android avd" from Command Promt to use the graphical manager to setup an emulator image to work with for running your app on. The graphical tool is fairly straight forward to use.