Error in installing "devtools" package

Problem: Struggling to troubleshoot the error I am receiving when I attempt to install the "devtools" package in R Studio.

Error: package or namespace load failed for ‘devtools’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]): namespace ‘cli’ 3.0.0 is already loaded, but >= 3.1.0 is required

This is part of a bigger issue I am running into when I attempt to install the metameta package from this person's github using the following code:

devtools::install_github("dsquintana/metameta")
library(metameta)

Any help would be so appreciated!

is telling you to

update.packages(cli)

Thank you! Have tried the following but still same error--is there anything else I could try ?

update.packages("cli")
library(cli)
library("devtools")

Error: package or namespace load failed for ‘devtools’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]): namespace ‘cli’ 3.0.0 is already loaded, but >= 3.1.0 is required

1 Like

Any chance you have not restarted the R session?

To download packages from GitHub try the remotes package. It is a lightweight replacement of the install_* functions in the devtools package, with most of the code copied over from devtools.

3 Likes

This suggests that the updated process has not been successful. We need more information to help you, please post the complete console output you get when run this command

install.packages("cli")

Thank you so very much--installing the remotes package instead worked!

I used the work around recommended above but in case I can fix something for the future, this is the console output when I run the command to install "cli":

install.packages("cli")
Installing package into ‘C:/Users/naomi/Documents/R/win-library/4.1’
(as ‘lib’ is unspecified)
also installing the dependency ‘glue’

There is a binary version available but the source version is later:
binary source needs_compilation
cli 3.1.1 3.2.0 TRUE

trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.1/glue_1.6.1.zip'
Content type 'application/zip' length 173950 bytes (169 KB)
downloaded 169 KB

package ‘glue’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
C:\Users\naomi\AppData\Local\Temp\RtmpqWG75c\downloaded_packages
installing the source package ‘cli’

trying URL 'https://cran.rstudio.com/src/contrib/cli_3.2.0.tar.gz'
Content type 'application/x-gzip' length 493192 bytes (481 KB)
downloaded 481 KB

  • installing source package 'cli' ...
    ** package 'cli' successfully unpacked and MD5 sums checked
    ** using staged installation
    ** libs

*** arch - i386
/mingw32/bin/gcc -I"C:/PROGRA~1/R/R-4.1.2/include" -DNDEBUG -O2 -Wall -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c ansi.c -o ansi.o
/mingw32/bin/gcc -I"C:/PROGRA~1/R/R-4.1.2/include" -DNDEBUG -O2 -Wall -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c cleancall.c -o cleancall.o
/mingw32/bin/gcc -I"C:/PROGRA~1/R/R-4.1.2/include" -DNDEBUG -O2 -Wall -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c diff.c -o diff.o
diff.c: In function 'clic_diff_chr':
diff.c:114:3: warning: 'sn' may be used uninitialized in this function [-Wmaybe-uninitialized]
for (i = 0; i < sn; i++, op_ptr++, off_ptr++, len_ptr++) {
^~~
/mingw32/bin/gcc -I"C:/PROGRA~1/R/R-4.1.2/include" -DNDEBUG -O2 -Wall -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c errors.c -o errors.o
/mingw32/bin/gcc -I"C:/PROGRA~1/R/R-4.1.2/include" -DNDEBUG -O2 -Wall -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c init.c -o init.o
/mingw32/bin/gcc -I"C:/PROGRA~1/R/R-4.1.2/include" -DNDEBUG -O2 -Wall -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c md5.c -o md5.o
/mingw32/bin/gcc -I"C:/PROGRA~1/R/R-4.1.2/include" -DNDEBUG -O2 -Wall -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c progress-altrep.c -o progress-altrep.o
/mingw32/bin/gcc -I"C:/PROGRA~1/R/R-4.1.2/include" -DNDEBUG -O2 -Wall -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c progress.c -o progress.o
/mingw32/bin/gcc -I"C:/PROGRA~1/R/R-4.1.2/include" -DNDEBUG -O2 -Wall -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c sha256.c -o sha256.o
/mingw32/bin/gcc -I"C:/PROGRA~1/R/R-4.1.2/include" -DNDEBUG -O2 -Wall -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c thread.c -o thread.o
/mingw32/bin/gcc -I"C:/PROGRA~1/R/R-4.1.2/include" -DNDEBUG -O2 -Wall -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c tty.c -o tty.o
/mingw32/bin/gcc -I"C:/PROGRA~1/R/R-4.1.2/include" -DNDEBUG -O2 -Wall -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c utf8.c -o utf8.o
/mingw32/bin/gcc -I"C:/PROGRA~1/R/R-4.1.2/include" -DNDEBUG -O2 -Wall -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c win-utf8.c -o win-utf8.o
/mingw32/bin/gcc -I"C:/PROGRA~1/R/R-4.1.2/include" -DNDEBUG -O2 -Wall -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c winfiles.c -o winfiles.o
/mingw32/bin/gcc -shared -s -static-libgcc -o cli.dll tmp.def ansi.o cleancall.o diff.o errors.o init.o md5.o progress-altrep.o progress.o sha256.o thread.o tty.o utf8.o win-utf8.o winfiles.o -LC:/PROGRA~1/R/R-4.1.2/bin/i386 -lR
installing to C:/Users/naomi/Documents/R/win-library/4.1/00LOCK-cli/00new/cli/libs/i386

*** arch - x64
/mingw64/bin/gcc -I"C:/PROGRA~1/R/R-4.1.2/include" -DNDEBUG -O2 -Wall -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c ansi.c -o ansi.o
/mingw64/bin/gcc -I"C:/PROGRA~1/R/R-4.1.2/include" -DNDEBUG -O2 -Wall -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c cleancall.c -o cleancall.o
/mingw64/bin/gcc -I"C:/PROGRA~1/R/R-4.1.2/include" -DNDEBUG -O2 -Wall -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c diff.c -o diff.o
diff.c: In function 'clic_diff_chr':
diff.c:85:7: warning: 'sn' may be used uninitialized in this function [-Wmaybe-uninitialized]
int sn;
^~
/mingw64/bin/gcc -I"C:/PROGRA~1/R/R-4.1.2/include" -DNDEBUG -O2 -Wall -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c errors.c -o errors.o
/mingw64/bin/gcc -I"C:/PROGRA~1/R/R-4.1.2/include" -DNDEBUG -O2 -Wall -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c init.c -o init.o
/mingw64/bin/gcc -I"C:/PROGRA~1/R/R-4.1.2/include" -DNDEBUG -O2 -Wall -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c md5.c -o md5.o
/mingw64/bin/gcc -I"C:/PROGRA~1/R/R-4.1.2/include" -DNDEBUG -O2 -Wall -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c progress-altrep.c -o progress-altrep.o
/mingw64/bin/gcc -I"C:/PROGRA~1/R/R-4.1.2/include" -DNDEBUG -O2 -Wall -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c progress.c -o progress.o
/mingw64/bin/gcc -I"C:/PROGRA~1/R/R-4.1.2/include" -DNDEBUG -O2 -Wall -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c sha256.c -o sha256.o
/mingw64/bin/gcc -I"C:/PROGRA~1/R/R-4.1.2/include" -DNDEBUG -O2 -Wall -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c thread.c -o thread.o
/mingw64/bin/gcc -I"C:/PROGRA~1/R/R-4.1.2/include" -DNDEBUG -O2 -Wall -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c tty.c -o tty.o
/mingw64/bin/gcc -I"C:/PROGRA~1/R/R-4.1.2/include" -DNDEBUG -O2 -Wall -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c utf8.c -o utf8.o
/mingw64/bin/gcc -I"C:/PROGRA~1/R/R-4.1.2/include" -DNDEBUG -O2 -Wall -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c win-utf8.c -o win-utf8.o
/mingw64/bin/gcc -I"C:/PROGRA~1/R/R-4.1.2/include" -DNDEBUG -O2 -Wall -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c winfiles.c -o winfiles.o
/mingw64/bin/gcc -shared -s -static-libgcc -o cli.dll tmp.def ansi.o cleancall.o diff.o errors.o init.o md5.o progress-altrep.o progress.o sha256.o thread.o tty.o utf8.o win-utf8.o winfiles.o -LC:/PROGRA~1/R/R-4.1.2/bin/x64 -lR
installing to C:/Users/naomi/Documents/R/win-library/4.1/00LOCK-cli/00new/cli/libs/x64
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
converting help for package 'cli'
finding HTML links ... done
ansi-styles html
ansi_align html
ansi_columns html
ansi_has_any html
ansi_hide_cursor html
ansi_html html
ansi_html_style html
ansi_nchar html
ansi_palettes html
ansi_regex html
ansi_simplify html
ansi_strip html
ansi_strsplit html
ansi_strtrim html
ansi_strwrap html
ansi_substr html
ansi_substring html
ansi_toupper html
ansi_trimws html
boxx html
builtin_theme html
cat_line html
cli-config html
cli html
cli_abort html
cli_alert html
cli_blockquote html
cli_bullets html
cli_bullets_raw html
cli_code html
cli_debug_doc html
cli_div html
cli_dl html
cli_end html
cli_format html
cli_format_method html
cli_h1 html
cli_li html
cli_list_themes html
cli_ol html
cli_output_connection html
cli_par html
cli_process_start html
cli_progress_along html
cli_progress_bar html
cli_progress_builtin_handlers html
cli_progress_demo html
cli_progress_message html
cli_progress_output html
cli_progress_step html
cli_progress_styles html
cli_rule html
cli_sitrep html
cli_status html
cli_status_clear html
cli_status_update html
cli_text html
cli_ul html
cli_vec html
cli_verbatim html
code_highlight html
code_theme_list html
combine_ansi_styles html
console_width html
containers html
demo_spinners html
diff_chr html
diff_str html
faq html
format_error html
format_inline html
get_spinner html
hash_animal html
hash_emoji html
hash_md5 html
hash_sha256 html
inline-markup html
is_ansi_tty html
is_dynamic_tty html
is_utf8_output html
list_spinners html
make_ansi_style html
make_spinner html
match_selector html
match_selector_node html
num_ansi_colors html
parse_selector html
pluralization-helpers html
pluralization html
pluralize html
progress-c html
progress-utils html
progress-variables html
rule html
ruler html
simple_theme html
spark_bar html
spark_line html
start_app html
style_hyperlink html
symbol html
test_that_cli html
themes html
tree html
unicode-width-workaround html
utf8_graphemes html
utf8_nchar html
utf8_substr html
*** copying figures
** building package indices
** testing if installed package can be loaded from temporary location
*** arch - i386
*** arch - x64
** testing if installed package can be loaded from final location
*** arch - i386
*** arch - x64
** testing if installed package keeps a record of temporary installation path

  • DONE (cli)

The downloaded source packages are in
‘C:\Users\naomi\AppData\Local\Temp\RtmpqWG75c\downloaded_packages’

Recent versions of devtools already import remotes under the hood because that functionality is no longer implemented on devtools itself so a separate installation of remotes shouldn't make any difference.

It is likely that your problem has been solved just by restarting your R session since there are not any issues in your installation logs.

Although, I have noticed you have both x32 and x64 versions of R installed, if you don't actually need the x32 version, it would be an unnecessarily overhead and possible source of installation issues.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.