jspm / npm

NPM Location Service
19 stars 34 forks source link

EINVAL: invalid argument, chown #169

Closed michaelfoley1 closed 6 years ago

michaelfoley1 commented 6 years ago

I recently attempted to run jspm:upgrade inside a docker container configured with user namespace remapping enabled.

It's worth noting that i didn't get this error when i wasn't inside the container.

I quickly found myself with the following error:

     Configuration file jspm.config.js does not exist, create it?: Yes
     Creating registry cache...
...
...
...
     Downloading npm:video.js@5.12.6

err  Error on download for npm:video.js
Error: EINVAL: invalid argument, chown '/root/.jspm/packages/npm/video.js@5.12.6/package.json'

Tracing this error back to origin i found that it originated here: mafintosh/tar-fs/blob/v1.16.0/index.js#L231

chown(name, header.uid, header.gid, cb)

It was being called with these args:

chown("/root/.jspm/packages/npm/video.js@5.12.6/package.json",
   56734284,
   1075358037, 
   function (err) {
       self._locked = false
       if (err) return self.destroy(err)
       if (!self._stream) oncontinue()
   }
);

here's my attempt at validating the error using the command line:

bash-4.3# chown 56734284:1075358037 /root/.jspm/packages/npm/video.js\@5.12.6/package.json 
chown: /root/.jspm/packages/npm/video.js@5.12.6/package.json: Invalid argument
bash-4.3#
aluanhaddad commented 6 years ago

Thanks for the bug report and for the fix!

michaelfoley1 commented 6 years ago

No worries, thanks for responding so quickly.

Would it be possible to get a release tagged? I believe we're up to 0.30.4

aluanhaddad commented 6 years ago

Let us ask @guybedford.

guybedford commented 6 years ago

Sure, I've published a 0.30.4.