Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pnpm root -g EROFS: read-only file system on NixOS #2794

Closed
vyorkin opened this issue Aug 22, 2020 · 1 comment
Closed

pnpm root -g EROFS: read-only file system on NixOS #2794

vyorkin opened this issue Aug 22, 2020 · 1 comment
Milestone

Comments

@vyorkin
Copy link

vyorkin commented Aug 22, 2020

eslint server tries to run the

$pnpm root -g                                                                                                                          

which results in error:

 ERROR  EROFS: read-only file system, open '/nix/store/yriqd0gdmlpfvlwzkq1d303d3appnwwi-nodejs-12.18.3/bin/_tmp_29693_1f5bd2552f0cc9720c2e495cff368f3b'

on NixOS (which is not FHS compliant)

@milahu
Copy link
Contributor

milahu commented Jan 12, 2021

fix packages/global-bin-dir/src/index.ts

  function canWriteToDirAndExists (dir: string) {
    try {
      return canWriteToDir(dir)
    } catch (err) {
-     if (err.code !== 'ENOENT') throw err
+     if (err.code !== 'ENOENT' && err.code !== 'EROFS') throw err
      return false
    }
  }

to get pnpm i -g working

echo 'export PATH="$HOME/.npm-global/bin:$PATH"' >>~/.bashrc
echo "prefix=$HOME/.npm-global/" >>~/.npmrc
source ~/.bashrc
pnpm i -g dummy-package

maybe pnpm should print a warning if ${prefix}/bin is not in $PATH?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants