I have installed Visual Studio on my Linux(Ubuntu) machine but while I am opening it gives me error like...
By deleting the directory Code inside /home/[USERNAME]/.config, you'll be able to launch VScode again.
Step by step (replace USERNAME by your username):
$ cd /home/[USERNAME]/.config
$ sudo rm -rf Code
[enter your password if needed]
Then launch VSCode. It might probably take a moment till VSCode shows up, because the deleted folder will be recreated on launch.
Related
Trying to add path to locate flutter so 'flutter doctor' can be run, to solve zsh: command not found: flutter,
then I found that creating below is first step to solution, but again terminal says nano ~/.bash_profile zsh: command not found: nano
then trying to create bash profile also not working, may be it's existing, but somehow it says below.
$HOME/.bash_profile
zsh: permission denied: /Users/prettygirl/.bash_profile
terminal is given full file access in macOS
restarted my macmini
vscode quitted and restarted,
terminal quitted and restarted
problem still persists. Is there any way to add path variables easily than going through all this hassle with terminal? like macos menu or something to add system path variables?
You're trying to open your bash_profile using nano (text editor) which you don't have installed. You can open that file using any text editor you have. Also, I see you're using zsh and not bash, this means that you should actually edit your ~/.zshrc or ~/.zprofile instead and add
PATH=</path/to/flutter>:$PATH
where you replace </path/to/flutter> with the actual path to flutter on your machine. You can do this if you don't want to add it manually:
echo 'export PATH=</path/to/flutter>:$PATH' >> ~/.zshrc && source ~/.zshrc
again, replacing </path/to/flutter> with your actual flutter path.
This is the only thing that worked for me.
Go to where your flutter folder is and right-click, get info, and copy where the path then paste it in the YOUR_PATH part below.
Open the .zshrc file using the command: nano ~/.zshrc,
Now add the following to the file: export PATH="$PATH:/YOUR_PATH/flutter/bin/"
Save the file by pressing Control + X followed by Enter.
Apply the changes by command: source ~/.zshrc
I can add the "shell command install 'code' command". Testing it works, but if i close out of the VS Code or after a couple of hours of adding the command it doesn't work. Terminal says "zsh: command not found: code" and on VS when click on the "shell command install code command" has a "EACCES: permission denied, unlink 'usr/local/bin/code' " pop up. How should i go about this? I'm using a macbook 2020 if that matters
Uninstall the code command from PATH in VS Code and reinstall it.
Open the command palette in VS Code using cmd + shift + p. Search "uninstall 'code'" and select the first option to uninstall.
Once uninstalled, "install 'code'" for installing.
That should fix it.
This happened to me on Macbook Pro M1 Chip. Basically follow this:
Simply uninstall the code command from PATH in vscode and reinstalled. i.e open the command pallete, search "uninstall 'code'" and select the first option to uninstall. Do same for installing too. That should fix it.
Found this solution on github
Try run:
sudo chown -R yourUsername /usr/local/bin
This command solves user just for copy paste.
sudo chown -R $USER /usr/local/bin
From a sample size of me and three friends, this is a common problem on M1 MacBooks and Mac Minis. Running the command:
sudo chown -R yourUsername /usr/local/bin
This resolved the VS issue for me and allowed me to install npm packages globally.
For Mac I have run below steps in my terminal and it resolve my issue.
you can also Try:
Open terminal.
sudo chown -R your_user_name /usr/local/bin
Open visual studio code.
use keybord command + shift + p
Type the bellow command.
install 'code'
Vs Code
For test go to terminal and run code .
I've run into this a few times on before. Steps I took to that fixed it for me:
open vs code and press cmd + shift + p to open the command palette
search for uninstall 'code' and press Enter
lastly, search for install 'code' and press Enter
For macOS:
Try uninstalling and reinstalling. (command + shift + p) >shell Command: Uninstall 'code' command from Path
append the following to your ~/.bash_profile file (~/.zshrc in case you use zsh).
code () { VSCODE_CWD="$PWD" open -n -b "com.microsoft.VSCode" --args $* ;}
I was getting same error to Install on Windows 11:
Just deleted folder C:\Users\my-username\AppData\Local\Programs\Microsoft VS Code\bin
Also removed VS Code from environment variables
Installed successfully!
for any mac users, you can try
sudo rm -f /usr/local/bin/code
That should help. It's important to note that you should be careful using sudo, since you can do a lot of damage in files and folders with it. But in the most dire instances, you should use it, similar to using any kind of --force commands, you should not use it often.
I have just installed debian 10 as well as vscode. I have been struggling with this for 3 days now.. I installed texlive from terminal with the following command:
sudo apt install texlive
I then installed the latex workshop extension in vscode and tried building a .tex file. The following error popped up:
Recipe terminated with fatal error: spawn latexmk ENOENT.
I then preceded to install latexmk from terminal with:
sudo apt install latexmk
The same error kept popping up after that. The output showed this.
[14:59:34] Recipe step env: {}
[14:59:34] cwd: /home/phoenix/Documents/stellies/year4/2021/s&s-414/pracs/prac-4/report
[14:59:34] LaTeX build process spawned. PID: undefined.
[14:59:35] LaTeX fatal error: spawn latexmk ENOENT, . PID: undefined.
[14:59:35] Does the executable exist? PATH: /app/bin:/usr/bin:/home/phoenix/.var/app/com.visualstudio.code-oss/data/node/bin:/home/phoenix/.var/app/com.visualstudio.code-oss/data/cargo/bin:/home/phoenix/.var/app/com.visualstudio.code-oss/data/python/bin
[14:59:35] The environment variable $SHELL: /bin/sh
I then proceded to review the texlive website. I noticed that i did not set the path variable to include the texlive binaries. The texlive website gives the following path to the binary files : PATH=/usr/local/texlive/2021/bin/x86_64-linux:$PATH
however /usr/local/texlive does not exist on my system for some reason. Where can i find the correct path to the texlive binaries on Debian 10?
I had the same problem. The root cause was: (1) software's bin folder missing from PATH; (2) bad file privileges. Consequently, VSC couldn't access latexmk, which explains the error messages.
In my case, the problem occurred on a mac, and specifically after I installed MacTex, which, in turn, installs Tex Live. I believe the same solution may apply to linux distros too.
Solution:
Claim file ownership (which was originally root) under folder /usr/local/texlive: sudo chown -R <username> /usr/local/texlive, where <username> is the OS-level user name. The fix will work for this specific user. If it is not enough, try instead setting group owner appropriately, and/or consider Step 3.
Add /usr/local/texlive/2021/bin/<software_dialect> to PATH. <software_dialect> depends on the installed software version: in my case it is universal-darwin; on linux it might be x86_64-linux.
If the problem persists, try to change file access permissions under /usr/local/texlive using chmod.
EDIT: As a final step, restart VSC for changes to take effect.
I recently encountered the same problem on MacOS Monterrey (M1 based). I used basictex (just for the context). As required by the installation instruction,
I added TeXLive to PATH,
installed latexmk package to the TeX distribution.
However, still got the same error as OP.
Afte reading the wiki again more carefully, what finally worked for me was as simple as restarting VS Code and MacOS. Everything works as expected after a reboot of the MAC.
I had this same problem on Mac recently, the fix that worked for me was to uninstall and reinstall the LaTeX Workshop extension.
I got the same issue , seems to be a misbehaving from Vscode on MacOS
check if the command is in the path on mac
-which command_you are running example which latexmk
If this output something that means you have your latex installed, otherwise go and installed it and make sure it is accessible via command line.
If latex is installed and you are getting that issue you can just restart your VSCode and everything will be okay.
Had a similar error and came across this post when looking for a solution.
I wanted to use texlive on Vscode with WSL2 on Windows 10. Installing texlive-full in wsl fixed this error for me.
On Mac, this is a way to fix the issue
Step1: reinstall mactex by downloading it from this link: http://www.tug.org/mactex/mactex-download.html
Step2: In your terminal do cd /usr/local, you should see texlive folder
Step3: In your terminal do sudo vim etc/paths to set the environment. Details are in this link: https://www.architectryan.com/2012/10/02/add-to-the-path-on-mac-os-x-mountain-lion/
Step4: In your terminal do /usr/local/texlive/2021/bin/x86_64-linux at the bottom. check the folder to see if the year is correct. Details in: http://www.tug.org/texlive/quickinstall.html.
Step5: Quit VC code completely, and reopen it.
When I tried to open vscode in WSL bash on Ubuntu 20.04 using command code ., it failed and the following message was logged:
/mnt/c/Users/john/.vscode/extensions/ms-vscode-remote.remote-wsl-0.50.1/scripts/wslCode.sh: 57: /home/john/.vscode-server/bin/d2e414d9e4239a252d1ab117bd7067f125afd80a/bin/code: not found
I would like to ask how to fix this problem? Thx a lot!
I found the solution. Even though I think that you've already know it.
You need to delete the folder /home/john/.vscode-server/ with sudo rm -rf /home/john/.vscode-server.
Then, you just run code . or try to open any project that you want it.
Then a script will load and will install a new .vscode-server in your machine with the right files.
I m getting the below error in visual studio code
when i click on reopen this alert kept coming and not allowing me to write the code inside the editor. I have uninstall and reinstall visual studio code but still its showing this error.
Try terminating any Code.exe processes still alive in Task Manager
Mac only:
$ open /Applications/Visual\ Studio\ Code.app -n
For context:
-n, --new Open a new instance of the application even if one is already running. Thanks #TMG. More options can be found in the docs: https://code.visualstudio.com/docs/editor/command-line
I have VS Code v1.38.1 installed on Ubuntu 18.4
encounter a similar crashing issue (failed to launch Code) today.
It is possibly due to Ubuntu stopped while Code was open.
To resolve this issue, I did the following
$ cd ~/.config/Code
$ rm -rf Cache/
$ rm -rf CacheData/
$ rm -rf CacheExtensions/
Visual Studio Code states probable reason for that: