rstudio send error when opening scripts on command line (after update) - Stack Overflow

admin2025-04-25  6

Problem

After updating RStudio, I’m experiencing issues when trying to open R scripts directly from the terminal. While launching RStudio itself works fine, running commands like the one below leads to errors:

$ rstudio transfer_plot.R --trace-warnings

Error Message

The terminal outputs the following error, and although Rstudio will open, the script does not.

[19145:0116/105906.726402:ERROR:atom_cache(229)] Add _NET_RESTACK_WINDOW to kAtomsToCache
(node:19145) UnhandledPromiseRejectionWarning: TypeError: Cannot read properties of undefined (reading 'send')
    at o (/usr/lib/rstudio/resources/app/.webpack/main/index.js:20:102919)
    at /usr/lib/rstudio/resources/app/.webpack/main/index.js:20:96586
    at emitUnhandledRejectionWarning (node:internal/process/promises:298:15)
    at warnWithErrorCodeUnhandledRejectionsMode (node:internal/process/promises:406:5)
    at processPromiseRejections (node:internal/process/promises:470:17)
    at process.processTicksAndRejections (node:internal/process/task_queues:96:32)
(node:19145) TypeError: Cannot read properties of undefined (reading 'send')
    at o (/usr/lib/rstudio/resources/app/.webpack/main/index.js:20:102919)
    at /usr/lib/rstudio/resources/app/.webpack/main/index.js:20:96586

What I've tried

If I open the script from within rstudio (launched from either the desktop, or the terminal) the script will open, and function fine. I've tested other scripts (including a blank 'test.R' script) these throw out the same error.

I've tried updating and upgrading my OS, as well as uninstalling, purging and reinstalling rstudio multiple times.

Question

How can I repair my installation for Rstudio to regain the functionality to open rscripts from the command-line again?

Environment details

OS: Ubuntu 22.04.5 LTS x86_64

R version 4.4.2 (2024-10-31) -- "Pile of Leaves"

RStudio 2024.12.0+467 "Kousa Dogwood" Release (cf37a3e5488c937207f992226d255be71f5e3f41, 2024-12-11) for Ubuntu Jammy Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) rstudio/2024.12.0+467 Chrome/126.0.6478.234 Electron/31.7.6 Safari/537.36, Quarto 1.5.57

转载请注明原文地址:http://anycun.com/QandA/1745535364a90895.html