Skip to main content

Troubleshooting

Problems I’ve run into with R in VS Code on Windows, with cause and fix.
Modified

November 9, 2026

The R terminal closes with exit code -1, or radian “is not recognized”

Cause: VS Code, and every terminal it opens, keeps the PATH from when VS Code was started. If you installed Python, radian or R (or changed PATH) while VS Code was running, it does not see them yet. Developer: Reload Window does not refresh PATH.

Fix: quit every VS Code window, then start VS Code again. Check in a new terminal with Get-Command radian.

The R terminal hangs at start, and the status bar says R: (not attached)

The terminal starts radian but never shows the R prompt, also after reloading the window.

Cause: a lock left over from vscode-R’s first-time sess setup (step 10). Before it installs sess for an R version, vscode-R creates a .setup-lock folder and asks for permission. If that is interrupted, for example by reloading the window while the pop-up is open, the folder stays, and every new R terminal waits for it. vscode-R never removes such a lock on its own.

Fix:

  1. Make sure no R terminal is still busy installing sess.

  2. Delete the .setup-lock folders under %APPDATA%\Code\User\globalStorage\reditorsupport.r\sess (there is one level per platform, R version and vscode-R revision):

    Get-ChildItem "$env:APPDATA\Code\User\globalStorage\reditorsupport.r\sess" -Recurse -Directory -Force -Filter .setup-lock |
      Remove-Item

    A terminal that was waiting then goes on to the R prompt, without sess.

  3. Open a new R terminal and approve the sess installation.

radian or VS Code starts an old R version

radian --version or R.version.string shows an older R than your rig default version.

Cause: something pins R before rig gets a say:

  1. an R_HOME environment variable. It can be a user variable as well as a system one;
  2. a version folder such as C:\Program Files\R\R-x.y.z\bin on PATH;
  3. a workspace .vscode/settings.json with r.executablePath or --r-binary (that one is on purpose, see R versions).

Fix: remove R_HOME (System Properties → Environment Variables, check both lists), remove the version folder from PATH, restart VS Code. The PATH check shows what a new process will see.

“Backend ‘lintr’ requires lintr >= 3.3.0-1”

Backend ‘lintr’ requires lintr >= 3.3.0-1. Install it or select another backend.

The R terminal may also not finish loading.

Cause: linting needs lintr 3.3.0-1 or newer. Packages are per R version, so a version you have not used for a while still has the old lintr.

Fix: install.packages("lintr") in the R version that is active, then restart VS Code (or the R language server).

Red or struck-through R settings

vscode-R 3.x renamed these settings:

Old New
r.rterm.windows r.consolePath
r.rterm.option r.consoleArgs
r.rpath.windows r.executablePath
r.rtermSendDelay r.consoleSendDelay
r.plot.useHttpgd r.plot.backend ("httpgd")

One exception: the R Debugger extension still reads only r.rpath.windows. Where r.executablePath is set, for example in a project pin, keep r.rpath.windows with the same value.

A setting changed on one machine never arrives on the other

Cause: Settings Sync silently skips machine-scoped settings, and several vscode-R settings are machine-scoped.

Fix: the settingsSync.ignoredSettings list with a - prefix, in the Default profile and in each synced profile. Details in the gotcha.

rig add release hangs with no output

Cause: it waits for the Windows administrator (UAC) prompt, which may be behind other windows.

Fix: find and accept the prompt. If rig fails at once with “The operation was canceled by the user”, it could not show the prompt: run it in a normal or elevated PowerShell window.

rig is not found right after installing it

Cause: the terminal was opened before rig was added to PATH.

Fix: open a new terminal.

R uses an old Quarto after upgrading Quarto

quarto --version in PowerShell shows the new version, but rendering from R uses the old one.

Cause: R finds another Quarto first: QUARTO_PATH is set (for example in a .Rprofile), or an older copy comes earlier on PATH.

Fix: remove QUARTO_PATH and the old PATH entry, so that R finds the current Quarto (see .Rprofile).

Errors at every R start-up, or settings from the wrong .Rprofile

Error in loadNamespace(x) : there is no package called ‘btw’

Cause: either a .Rprofile calls a package that this R version does not have (each R version has its own library), or R reads a different .Rprofile than you think: one in the current folder wins over the one in Documents.

Fix: guard optional packages with requireNamespace("pkg", quietly = TRUE), and keep only one user .Rprofile (details).

radian installs but crashes or will not start

Cause: usually a Python version radian does not support yet, or a second Python earlier on PATH.

Fix: use Python 3.12 and make sure it comes first on PATH: Get-Command python, radian must both point to Python312. If pip install radian fails while compiling, install the Microsoft C++ Build Tools.

Plots open in a separate window, not in VS Code

Cause: httpgd is not installed for the active R version, so the .Rprofile and vscode-R fall back to the standard Windows graphics device.

Fix: install.packages("httpgd"), then restart the R terminal.