Failed to install any r packages

Hi, could anyone please help me with the r error when I want to install any packages, I am taking Biobase as an example below

Skipping 1 packages not available: Biobase
Installing 26 packages: RcppArmadillo, matrixStats, Rcpp, conquer, MatrixModels, SparseM, utf8, crayon, vctrs, rlang, pillar, lifecycle, fansi, ellipsis, colorspace, viridisLite, R6, farver, quantreg, mcmc, tibble, isoband, digest, MCMCpack, ggplot2, nnls
Installing packages into ‘/project/rohs_102/jiaweih/projects/R/packages’
(as ‘lib’ is unspecified)
Error: Failed to install 'unknown package' from GitHub:
  unable to create temporary directory ‘/tmp/Rtmp5z1Rc4/downloaded_packages’
In addition: Warning messages:
1: In dir.create(tmpd) :
  cannot create dir '/tmp/Rtmp5z1Rc4/downloaded_packages', reason 'No such file or directory'
2: In file(con, "wb") :
  cannot open file '/tmp/Rtmp5z1Rc4/file5f4c439189e6': No such file or directory

can anyone help me? Thanks in advance

@jiaweih What node are you on, what R version are you using, and what command are you using? Are you using BiocManager? I’m able to install this package with: BiocManager::install("Biobase")

I am using the login node, I believe, and the R is 4.0.3 through module load

Okay, it appears you’re not able to create temporary files for some reason. If you enter the command mktemp in the shell, what output do you get? And could you try using another login node to test?

Thanks, I typed mktemp and get the following output
image
each time I typed, it gives me different output.

Okay, so you can make tempfiles in the shell but not within R. Do you have any R configurations that might affect this?

Also try this:

export TMPDIR=/scratch/jiaweih

And then open R and try installing again.

Thank you very much, I tried and it works now.