RStudio 遇到致命错误并在 R 中出现每个错误时重新启动

RStudio encounters fatal error and restarts on EVERY error in R

我最近换了雇主,只有虚拟机的本地管理员权限 运行 Windows。我安装了 R 和 RStudio,两者都工作正常,直到我犯了一个错误——任何错误。一旦发生这种情况,RStudio 就会给出可怕的“致命错误”消息并重新启动。代表很简单。启动 RStudio 并键入 as.Date('a')。这会报错并导致 Rstudio 关闭。这似乎是一个 java 错误,关键问题是 (TypeError) : Cannot read property 'M' of null;。在 RStudio 的支持论坛中有 many requests 寻求帮助的类似崩溃尚未得到解答,这就是为什么我在这里重复这个问题。

下面发布的会话信息和 RStudio 崩溃日志

会话信息

R Under development (unstable) (2022-02-04 r81652 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 22000)

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.utf8  LC_CTYPE=English_United States.utf8    LC_MONETARY=English_United States.utf8
[4] LC_NUMERIC=C                           LC_TIME=English_United States.utf8    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
[1] compiler_4.2.0 tools_4.2.0

RStudio 日志

2022-02-09T17:56:41.573000Z [rsession-AvrahamAdler] WARNING findProgramOnPath returns wrong result: C:\Users\AVRAHA~1\AppData\Local\Programs\MiKTeX\miktex\bin\x64\pdflatex.exe != C:/Users/AvrahamAdler/AppData/Local/Programs/MiKTeX/miktex/bin/x64/pdflatex.exe; LOGGED FROM: class rstudio::core::FilePath __cdecl rstudio::session::module_context::findProgram(const class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > &) src/cpp/session/SessionModuleContext.cpp:1206
2022-02-09T17:56:41.573000Z [rsession-AvrahamAdler] WARNING findProgramOnPath returns wrong result: C:\Users\AVRAHA~1\AppData\Local\Programs\MiKTeX\miktex\bin\x64\pdflatex.exe != C:/Users/AvrahamAdler/AppData/Local/Programs/MiKTeX/miktex/bin/x64/pdflatex.exe; LOGGED FROM: class rstudio::core::FilePath __cdecl rstudio::session::module_context::findProgram(const class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > &) src/cpp/session/SessionModuleContext.cpp:1206
2022-02-09T17:56:41.577000Z [rsession-AvrahamAdler] WARNING findProgramOnPath returns wrong result: C:\Users\AVRAHA~1\AppData\Local\Programs\MiKTeX\miktex\bin\x64\pdflatex.exe != C:/Users/AvrahamAdler/AppData/Local/Programs/MiKTeX/miktex/bin/x64/pdflatex.exe; LOGGED FROM: class rstudio::core::FilePath __cdecl rstudio::session::module_context::findProgram(const class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > &) src/cpp/session/SessionModuleContext.cpp:1206
2022-02-09T17:56:41.577000Z [rsession-AvrahamAdler] WARNING findProgramOnPath returns wrong result: C:\Users\AVRAHA~1\AppData\Local\Programs\MiKTeX\miktex\bin\x64\pdflatex.exe != C:/Users/AvrahamAdler/AppData/Local/Programs/MiKTeX/miktex/bin/x64/pdflatex.exe; LOGGED FROM: class rstudio::core::FilePath __cdecl rstudio::session::module_context::findProgram(const class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > &) src/cpp/session/SessionModuleContext.cpp:1206
2022-02-09T17:56:43.063059Z [rsession-AvrahamAdler] ERROR CLIENT EXCEPTION (rsession-AvrahamAdler): (TypeError) : Cannot read property 'M' of null;|||org/rstudio/studio/client/workbench/views/source/editors/text/AceEditor.java#4487::setScrollSpeed|||org/rstudio/studio/client/workbench/views/source/editors/text/AceEditorMonitor.java#46::monitor|||org/rstudio/studio/client/workbench/views/source/editors/text/AceEditorMonitor.java#70::execute|||com/google/gwt/core/client/impl/SchedulerImpl.java#140::execute|||com/google/gwt/core/client/impl/Impl.java#306::apply|||com/google/gwt/core/client/impl/Impl.java#345::entry0|||rstudio-0.js#-1::eval|||com/google/gwt/cell/client/AbstractEditableCell.java#41::viewDataMap|||Client-ID: 33e600bb-c1b1-46bf-b562-ab5cba070b0e|||User-Agent: Mozilla/5.0 (Windows NT 10.0  Win64  x64) AppleWebKit/537.36 (KHTML, like Gecko) QtWebEngine/5.12.8 Chrome/69.0.3497.128 Safari/537.36
2022-02-09T17:56:43.063059Z [rsession-AvrahamAdler] ERROR CLIENT EXCEPTION (rsession-AvrahamAdler): (TypeError) : Cannot read property 'M' of null;|||org/rstudio/studio/client/workbench/views/source/editors/text/AceEditor.java#4487::setScrollSpeed|||org/rstudio/studio/client/workbench/views/source/editors/text/AceEditorMonitor.java#46::monitor|||org/rstudio/studio/client/workbench/views/source/editors/text/AceEditorMonitor.java#70::execute|||com/google/gwt/core/client/impl/SchedulerImpl.java#140::execute|||com/google/gwt/core/client/impl/Impl.java#306::apply|||com/google/gwt/core/client/impl/Impl.java#345::entry0|||rstudio-0.js#-1::eval|||com/google/gwt/cell/client/AbstractEditableCell.java#41::viewDataMap|||Client-ID: 33e600bb-c1b1-46bf-b562-ab5cba070b0e|||User-Agent: Mozilla/5.0 (Windows NT 10.0  Win64  x64) AppleWebKit/537.36 (KHTML, like Gecko) QtWebEngine/5.12.8 Chrome/69.0.3497.128 Safari/537.36

RStudio 即将推出 2022.02.0 版本。在我撰写本文时,它尚未发布,但您可以从 https://dailies.rstudio.com/ 获取每日构建。该版本的新闻包括声明

RStudio now supports the experimental UTF-8 UCRT builds of R (#9824)

所以它应该可以解决您的问题(根据评论,它确实解决了)。但是,请注意该网页顶部的警告:

Daily builds are intended for testing purposes, and are not recommended for general use. For stable builds, please visit rstudio.com.