ManuelHentschel / vscDebugger

(Partial) Implementation of the Debug Adapter Protocol for R
https://manuelhentschel.github.io/vscDebugger/
MIT License
90 stars 14 forks source link

Error running "rdebugger.updateRPackage" #188

Open johnnaaron opened 1 year ago

johnnaaron commented 1 year ago

Describe the bug When installing R debugger for the first time, running "rdebugger.updateRPackage" fails and exits with errors.

Error 1: "No such file or directory" file does exist Error 2: "No package called 'jsonlite'" package is installed

To Reproduce

  1. Install R through terminal brew install --cask r
  2. Install required R packages R install.packages(c('languageserver', 'httpgd', 'jsonlite', 'R6'))
  3. Install vscode-R for VSCode, install vscDebugger for VSCode
  4. Run rdebugger.updateRPackage the command palette (CMD+SHIFT+P)
  5. See error

Your R code N/A, print("Hello World")

Your Launch config N/A

Desktop

Additional context

Screenshot 2022-12-23 at 12 31 04 PM
mahmoud-shihab commented 1 year ago

Describe the bug When I try to run the debugger, I get a pop up saying: Please install the R package "vscDebugger"! And the terminal saying:

The debugger requires the R package "vscDebugger"!

It can be attempted to install this package and the dependencies (currently R6 and jsonlite) automatically.

To do so, run the following command in the command palette (ctrl+shift+p):

        r.debugger.updateRPackage

This feature is still somewhat experimental!

If this does not work or you want to make sure you have the latest version, follow the instructions in the readme to install the package yourself.

When I open the command pallet (ctrl+shift+p) and select the option R Debugger: Update or Install the required R Packages, I get the following message:

 *  Executing task in folder Personal: C:\Users\mshihab2\AppData\Local\Programs\R\R-4.2.2\bin\x64\R.exe --no-restore --quiet -f "c:\Users\mshihab2\.vscode\extensions\rdebugger.r-debugger-0.5.2\R\install.R" --args "https://github.com/ManuelHentschel/VSCode-R-Debugger/releases/download/v0.5.2/vscDebugger_0.5.2.zip" 

 *  The terminal process "C:\Users\mshihab2\AppData\Local\Programs\R\R-4.2.2\bin\x64\R.exe '--no-restore', '--quiet', '-f', '"c:\Users\mshihab2\.vscode\extensions\rdebugger.r-debugger-0.5.2\R\install.R"', '--args', '"https://github.com/ManuelHentschel/VSCode-R-Debugger/releases/download/v0.5.2/vscDebugger_0.5.2.zip"'" terminated with exit code: 3221225477. 
 *  Terminal will be reused by tasks, press any key to close it. 

Desktop (please complete the following information):

OS: Windows 10 21H2 R Version: Latest, 4.2.2 vscDebugger Version: N/A, does not install vscode-r-debugger Version: Latest, 0.5.2

TKMarkCheng commented 1 year ago

@mahmoud-shihab I think the issue is that the Rpackage needs to be installed but at the moment the vscode link on the vscode extension store is faulty.

I resolved the issue taking inspiration from @mvwestendorp's solution at https://github.com/ManuelHentschel/vscDebugger/issues/182 by install.packages("https://github.com/ManuelHentschel/vscDebugger/releases/download/v0.5.2/vscDebugger_0.5.2.zip", repos = NULL, type = "win.binary") on Rstudio or a Rterminal.

Check if you have it installed by library(vscDebugger) and ?vscDebugger-package

the-zucc commented 1 year ago

I've just had the same issue. The command itself in VSCode seems to fail. However, the files that are referenced still seem to work. Running the following (EDIT: running it as root is what made the difference) in a terminal gave me satisfying results:

/usr/bin/R --no-restore --quiet -f "/home/<YOUR_USER>/.vscode/extensions/rdebugger.r-debugger-0.5.2/R/install.R" --args "https://github.com/ManuelHentschel/VSCode-R-Debugger/releases/download/v0.5.2/vscDebugger_0.5.2.tar.gz"
jordantgh commented 1 year ago

@the-zucc thanks!

inregards2pluto commented 1 year ago

@mahmoud-shihab I think the issue is that the Rpackage needs to be installed but at the moment the vscode link on the vscode extension store is faulty.

I resolved the issue taking inspiration from @mvwestendorp's solution at #182 by install.packages("https://github.com/ManuelHentschel/vscDebugger/releases/download/v0.5.2/vscDebugger_0.5.2.zip", repos = NULL, type = "win.binary") on Rstudio or a Rterminal.

Check if you have it installed by library(vscDebugger) and ?vscDebugger-package

Just tried this and this worked for me as well!