r-lib / pak

A fresh approach to package installation
https://pak.r-lib.org
682 stars 62 forks source link

Install specific package version failed #684

Closed Yunuuuu closed 2 months ago

Yunuuuu commented 2 months ago
pak::pkg_install("tidyverse/ggplot2@v3.4.0")
#> ℹ Loading metadata database
#> ✔ Loading metadata database ... done
#> 
#> 
#> → Will update 1 package.
#> → The package (0 B) is cached.
#> + ggplot2 3.5.1 → 3.4.0 [bld][cmp] (GitHub: 63125db)
#> 
#> ℹ No downloads are needed, 1 pkg is cached
#> ℹ Building ggplot2 3.4.0
#> ✖ Failed to build ggplot2 3.4.0 (756ms)
#> Error: ! error in pak subprocess
#> Caused by error in `stop_task_build(state, worker)`:
#> ! Failed to build source package ggplot2.
#> Full installation output:
#> * installing *source* package ‘ggplot2’ ...
#> staged installation is only possible with locking
#> ** using non-staged installation
#> ** R
#> ** data
#> *** moving datasets to lazyload DB
#> ** inst
#> ** byte-compile and prepare package for lazy loading
#> Error in .make_numeric_version(x, strict, .standard_regexps()$valid_numeric_version) : 
#>   invalid non-character version specification 'x' (type: double)
#> Error: unable to load R code in package ‘ggplot2’
#> Execution halted
#> ERROR: lazy loading failed for package ‘ggplot2’
#> * removing ‘/tmp/RtmpM1tfiK/pkg-lib2adda1d10c2c8/ggplot2’

Created on 2024-09-06 with reprex v2.1.0

Session info ``` r sessioninfo::session_info() #> ─ Session info ─────────────────────────────────────────────────────────────── #> setting value #> version R version 4.4.0 (2024-04-24) #> os Ubuntu 24.04 LTS #> system x86_64, linux-gnu #> ui X11 #> language en #> collate C.UTF-8 #> ctype C.UTF-8 #> tz Asia/Shanghai #> date 2024-09-06 #> pandoc 3.1.3 @ /usr/bin/ (via rmarkdown) #> #> ─ Packages ─────────────────────────────────────────────────────────────────── #> package * version date (UTC) lib source #> cli 3.6.3 2024-06-21 [1] CRAN (R 4.4.0) #> digest 0.6.36 2024-06-23 [1] CRAN (R 4.4.0) #> evaluate 0.24.0 2024-06-10 [1] CRAN (R 4.4.0) #> fastmap 1.2.0 2024-05-15 [1] CRAN (R 4.4.0) #> fs 1.6.4 2024-04-25 [1] CRAN (R 4.4.0) #> glue 1.7.0 2024-01-09 [1] CRAN (R 4.4.0) #> htmltools 0.5.8.1 2024-04-04 [1] CRAN (R 4.4.0) #> knitr 1.47 2024-05-29 [1] CRAN (R 4.4.0) #> lifecycle 1.0.4 2023-11-07 [1] CRAN (R 4.4.0) #> magrittr 2.0.3 2022-03-30 [1] CRAN (R 4.4.0) #> pak 0.8.0.9000 2024-09-06 [1] Github (r-lib/pak@b84ff8b) #> purrr 1.0.2 2023-08-10 [1] CRAN (R 4.4.0) #> R.cache 0.16.0 2022-07-21 [1] CRAN (R 4.4.0) #> R.methodsS3 1.8.2 2022-06-13 [1] CRAN (R 4.4.0) #> R.oo 1.26.0 2024-01-24 [1] CRAN (R 4.4.0) #> R.utils 2.12.3 2023-11-18 [1] CRAN (R 4.4.0) #> reprex 2.1.0 2024-01-11 [1] CRAN (R 4.4.0) #> rlang 1.1.4 2024-06-04 [1] CRAN (R 4.4.0) #> rmarkdown 2.27 2024-05-17 [1] CRAN (R 4.4.0) #> sessioninfo 1.2.2 2021-12-06 [1] CRAN (R 4.4.0) #> styler 1.10.3 2024-04-07 [1] CRAN (R 4.4.0) #> vctrs 0.6.5 2023-12-01 [1] CRAN (R 4.4.0) #> withr 3.0.0 2024-01-16 [1] CRAN (R 4.4.0) #> xfun 0.45 2024-06-16 [1] CRAN (R 4.4.0) #> yaml 2.3.8 2023-12-11 [1] CRAN (R 4.4.0) #> #> [1] /home/yun/Rlibrary/4.4 #> [2] /usr/local/lib/R/site-library #> [3] /usr/lib/R/site-library #> [4] /usr/lib/R/library #> #> ────────────────────────────────────────────────────────────────────────────── ```
gaborcsardi commented 2 months ago

This is not a bug in pak. It is a bug in ggplot2, fixed in ggplot2 3.4.3. Use an older R version (R 4.3.x or older) or a newer ggplot2 version.

Yunuuuu commented 2 months ago

Thanks

Yunuuuu commented 2 months ago

Maybe we should change the Docs, since now pkg_install use tidyverse/ggplot2@v3.4.0 as an example. See https://github.com/r-lib/pak/blob/b84ff8bb92c32e67a22b01b9cee78976acab3882/R/package.R#L11