-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Code not found in path error #9
Comments
What version of VSCode are you using? The extension basically leverages The rest of the extension should be able to work (will need to put out a patch to do so though). |
VSCode version 1.4.0. code --install-extension runs with no errors, but I'm not seeing anything in my %USERPROFILE%.vscode\extensions folder, so something is not getting installed (if I understand the installation process.) I did find that, even though I'm getting errors, there are actual synchronization files in my One Drive App folder. So it appears that the export worked, even with the reported error. |
I noticed this error too. |
get same error in mac os x upon restart of vs code to enable the extenstion after installation. |
Unfortunately reattempting a re installation does not resolve the extension folder to be created in the user profile. As to executing the code.cmd under the C:\Program Files (x86)\Microsoft VS Code\bin folder in a cmd shell fails to create either of the environment variablesVSCode_Dev or Atom...Node. Hmm, looks like at the moment I've landed in a cul-de-sac. |
Found same issue, and running with the code.cmd file the extension seems to pick up settings correctly (as suggested by @K4pt4n ). Note I can run code from prompt (e.g. code --help or code --list-extensions) so there's no issue with code in path. Is there any way of modifying or checking the sync path once it's initially set, other than reinstalling the extension? |
Same issue. If I run from the command line it works fine. If I run from any icon or file association I see the error |
Visual Studio Code knows how to launch additional instances of itself, since it does this every time you test an extension in development. (see See https://github.com/golf1052/code-sync/blob/master/.vscode/launch.json#L9 |
For those of you having problem with "code was not found on your path", even though it is, do the following:
It will then launch and will ask you to set up your sync path. Update, well that does work, however the export file is never created. And if you relaunch as non admin, you get the other error: #11 |
I've noticed with Code 1.6 that I haven't been experiencing this issue at all. Can anybody else confirm? |
I just saw this with 1.6.1 and the codesync version 2.1.0. Running as Admin didn't seem to help even from the command prompt. |
Have the same problem on OSX 10.11.6 el Capitan, Code version 1.8.1 and 2.1.1 of CodeSync. 😞 Anyone here know JS on OSX? This is where it decides what is constituting whether 'code' is on the path: function isCodeOnPath() {
let version = '';
try {
version = child_process.execSync(getCodeCommand() + ' --version', { encoding: 'utf8' });
}
catch (e) {
return false;
}
if (version != '') {
return true;
}
return false;
}
exports.isCodeOnPath = isCodeOnPath;
function getCodeCommand() {
if (windows) {
return 'code.cmd';
}
else {
return 'code';
}
} I would think that modifying getCodeCommand() should get us where we need to be. |
problem: "Code was not found on your path, CodeSync is unable to activate!":
CodeSync will ask you to set up your sync path. |
Are there any fixes to this issue that will work for someone using the portable version of VS Code without Admin access on Windows? |
I had the same issue, it's because code is not set up to run from the command line / isn't in your path. From here: https://code.visualstudio.com/docs/setup/mac
This fixed it for me. |
Additionally, if you're using VS Code Insiders ( |
none of these workarounds have worked for me |
Same problem as of today, still no solutions? |
I've been pretty busy with finishing up college and moving but hopefully I should be able to take a good look at this within the next month or two. |
Still haven't been able to figure out why this is happening but version 2.3.0 makes it so that you will be able to use all the features except for importing or exporting extensions. Importing and exporting of settings, keybindings, and snippets will now work even if CodeSync thinks you don't have |
Returning and reviewing this thread, I managed to solve the problem on my Windows box. I discovered that the 'C:\Program Files (x86)\Microsoft VS Code\bin' directory was not in my %Path% environment variable. This was because VS-Code was installed using an Admin account which I do not develop under. |
I have added logging to version 2.4.0 to help with debugging this issue. If you are still experiencing this issue please paste your log here. The CodeSync log is located in the CodeSync output channel. |
I am also having this issue, but on macOS (High Sierra). CodeSync reports that |
Further to my previous comment, it looks as though my issue is related to the way that Code is launched, and not anything to do with CodeSync itself. I am now having similar issues with various internal commands, for example the Run Task command is unable to find If I launch Code by clicking on the icon, or by running I have no idea if this is an Alfred issue or a Code issue. |
@jacksleight What How is |
@cspotcode Node is added via .bash_profile, it's in I just tried your suggestion and it looks like when Alfred runs it's only getting a PATH with
Adding that has fixed the node related issues with ESLint and Run Task. However, it does not seem to have resolved the CodeSync issue. I still get the code is not found on path error when launching through Alfred. Really weird, I would have thought it was the same cause for everything. |
Alfred isn't launched via bash, so it's not getting any of your path
changes from .bashrc. I'm pretty sure there's another mechanism you need
to use to setup environment variables for apps on Mac.
…On Tue, Aug 21, 2018, 4:27 PM Jack Sleight ***@***.***> wrote:
@cspotcode <https://github.com/cspotcode> Node is added via
.bash_profile, it's in /opt/local/bin/node.
I just tried your suggestion and it looks like when Alfred runs it's only
getting a PATH with /usr/bin:/bin:/usr/sbin:/sbin, despite additional
paths being exported in .bash_profile. I've added this line to the Alfred
shell script and now PATH has everything in it:
source /Users/Jack/.bash_profile
Adding that has fixed the node related issues with ESLint and Run Task.
However, it does not seem to have resolved the CodeSync issue. I still get
the code is not found on path error when launching through Alfred. Really
weird, I would have thought it was the same cause for everything.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#9 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAW-uLfab6CUeE9uAXqdEaK_MvbOTFV8ks5uTG0cgaJpZM4JfQf3>
.
|
Same Error on Ubuntu, fresh OS and Application install |
I just got the error on Linux. Code-sync complains it cannot find |
I am in the exact same situation as @gildas $ which code
/snap/bin/code
$ ls -l /snap/bin
ls -l /snap/bin
total 0
lrwxrwxrwx 1 root root 13 Jan 3 16:12 code -> /usr/bin/snap
lrwxrwxrwx 1 root root 13 Jan 3 16:12 code.url-handler -> /usr/bin/snap And |
It may help to locate the error messages being logged from this function: ...and share them here. |
For those who've installed VSCode through Snap see this issue: #38 |
I am trying to sync several VMs, all using Windows 10. After enabling the extension and setting the sync folder (using the default in One Drive), I get the following error every time I open VS Code:
Code was not found on your path, CodeSync is unable to activate!
If I try to manually run any commands, like CodeSync: Export All, I get the following:
command 'extension.exportAll' not found.
I have double checked to make sure the path to VS Code is in the Path variable and found it is ("C:\Program Files (x86)\Microsoft VS Code\bin"
Thanks for any help!
The text was updated successfully, but these errors were encountered: