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

Yarn fakeroot problems #2536

Closed
joshkel opened this issue Jan 23, 2017 · 3 comments
Closed

Yarn fakeroot problems #2536

joshkel opened this issue Jan 23, 2017 · 3 comments

Comments

@joshkel
Copy link
Contributor

joshkel commented Jan 23, 2017

Do you want to request a feature or report a bug?

Bug

What is the current behavior?

I have a Debian package that invokes Yarn during the install step.

Under Yarn 0.18.1 and previous versions, this worked fine. Starting with Yarn 0.19.1, it fails:

dh binary
   dh_testroot
   dh_prep
   dh_auto_install
make[2]: Entering directory `<http://jenkins:8080/job/Nightly/ws/build-area/package-2.0.2'>
make install
yarn  --pure-lockfile
/usr/share/yarn/node_modules/mkdirp/index.js:90
                    throw err0;
                    ^

Error: EACCES: permission denied, mkdir '/usr/local/share/.cache'
    at Error (native)
    at Object.fs.mkdirSync (fs.js:922:18)
    at sync (/usr/share/yarn/node_modules/mkdirp/index.js:71:13)
    at Function.sync (/usr/share/yarn/node_modules/mkdirp/index.js:77:24)
    at Object.<anonymous> (/usr/share/yarn/bin/yarn.js:30:8)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)

If the current behavior is a bug, please provide the steps to reproduce.

fakeroot yarn add lodash

What is the expected behavior?

fakeroot yarn should work as well as running yarn by itself does.

I believe that this issue was introduced by #2150. Since fakeroot is commonly used in building Debian packages,

fakeroot sets the FAKEROOTKEY environment variable (see here), so one possible fix is to only switch to /usr/local/share if isRootUser(getUid()) && process.env.FAKEROOTKEY == null.

Please mention your node.js, yarn and operating system version.

Node 6.9.4
Yarn 0.19.1
Ubuntu 14.04

@steppefox
Copy link

I have the same problem T__T

@swilde
Copy link

swilde commented May 12, 2017

same here

@swilde
Copy link

swilde commented May 12, 2017

On a second look, the version I experience the problem with are different,

Using 0.21.3-1 debian package generation using fakeroot works.
But with 0.23.4-1 it fails.

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