Bad file descriptor after updating to 1.11.1-beta13

Hi David

I’m able to reproduce in newly created directories, but not always when rerunning in an emptied directory:

$ mkdir foo; cd foo; docker run -it --rm=true -v "pwd":/root node bash -c "cd \$HOME; npm i phantomjs-prebuilt"

Example error:

Extracting tar contents (via spawned process) Removing /root/node_modules/phantomjs-prebuilt/lib/phantom Copying extracted folder /root/node_modules/phantomjs-prebuilt/phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2-extract-1465222235140/phantomjs-2.1.1-linux-x86_64 -> /root/node_modules/phantomjs-prebuilt/lib/phantom Phantom installation failed { Error: EBADF: bad file descriptor, chmod '/root/node_modules/phantomjs-prebuilt/lib/phantom/third-party.txt' at Error (native) errno: -9, code: 'EBADF', syscall: 'chmod', path: '/root/node_modules/phantomjs-prebuilt/lib/phantom/third-party.txt' } Error: EBADF: bad file descriptor, chmod '/root/node_modules/phantomjs-prebuilt/lib/phantom/third-party.txt' at Error (native) npm info lifecycle phantomjs-prebuilt@2.1.7~install: Failed to exec install script