Medium / phantomjs

NPM wrapper for installing phantomjs
Other
1.43k stars 435 forks source link

Phantomjs 1.9.16 does not install on Ubuntu 14.04 running on Vagrant shared folder #341

Closed njbarrett closed 9 years ago

njbarrett commented 9 years ago

The issue, as originally reported in #279 is still an issue on Ubuntu 14.04 running on a Vagrant shared folder.

$ npm install phantomjs
\
> phantomjs@1.9.16 install /vagrant_host/ynab_shared_library/node_modules/phantomjs
> node install.js

Downloading https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-1.9.8-linux-x86_64.tar.bz2
Saving to /tmp/phantomjs/phantomjs-1.9.8-linux-x86_64.tar.bz2
Receiving...
  [=======================================-] 97% 0.0s
Received 12854K total.
Extracting tar contents (via spawned process)
Removing /vagrant_host/ynab_shared_library/node_modules/phantomjs/lib/phantom
Copying extracted folder /tmp/phantomjs/phantomjs-1.9.8-linux-x86_64.tar.bz2-extract-1428441311626/phantomjs-1.9.8-linux-x86_64 -> /vagrant_host/ynab_shared_library/node_modules/ph
antomjs/lib/phantom
Writing location.js file
Phantom installation failed { [Error: ENOTDIR, not a directory '/vagrant_host/ynab_shared_library/node_modules/phantomjs/lib/phantom/bin/phantomjs']
  errno: 27,
  code: 'ENOTDIR',
  path: '/vagrant_host/ynab_shared_library/node_modules/phantomjs/lib/phantom/bin/phantomjs',
  syscall: 'chmod' } Error: ENOTDIR, not a directory '/vagrant_host/ynab_shared_library/node_modules/phantomjs/lib/phantom/bin/phantomjs'
    at Object.fs.chmodSync (evalmachine.<anonymous>:832:18)
    at Object.chmodSync (/vagrant_host/ynab_shared_library/node_modules/phantomjs/node_modules/fs-extra/node_modules/graceful-fs/polyfills.js:141:17)
    at Promise.validExit [as _successFn] (/vagrant_host/ynab_shared_library/node_modules/phantomjs/install.js:145:8)
    at Promise._call (/vagrant_host/ynab_shared_library/node_modules/phantomjs/node_modules/kew/kew.js:373:13)
    at Promise._withInput (/vagrant_host/ynab_shared_library/node_modules/phantomjs/node_modules/kew/kew.js:333:25)
    at Promise.resolve (/vagrant_host/ynab_shared_library/node_modules/phantomjs/node_modules/kew/kew.js:105:27)
    at resolver (/vagrant_host/ynab_shared_library/node_modules/phantomjs/node_modules/kew/kew.js:409:17)
    at next (/vagrant_host/ynab_shared_library/node_modules/phantomjs/node_modules/fs-extra/node_modules/rimraf/rimraf.js:70:7)
    at CB (/vagrant_host/ynab_shared_library/node_modules/phantomjs/node_modules/fs-extra/node_modules/rimraf/rimraf.js:106:9)
    at Object.oncomplete (fs.js:107:15)
npm ERR! Linux 3.2.0-23-generic
npm ERR! argv "node" "/usr/bin/npm" "install" "phantomjs"
npm ERR! node v0.10.32
npm ERR! npm  v2.7.5
npm ERR! code ELIFECYCLE

npm ERR! phantomjs@1.9.16 install: `node install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the phantomjs@1.9.16 install script 'node install.js'.
npm ERR! This is most likely a problem with the phantomjs package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node install.js
npm ERR! You can get their info via:
npm ERR!     npm owner ls phantomjs
npm ERR! There is likely additional logging output above.
npm ERR! Linux 3.2.0-23-generic
npm ERR! argv "node" "/usr/bin/npm" "install" "phantomjs"
npm ERR! node v0.10.32
npm ERR! npm  v2.7.5
npm ERR! path npm-debug.log.d96adeda5efd8bee9b90041799f1e1c1
npm ERR! code ETXTBSY
npm ERR! errno 62

npm ERR! ETXTBSY, rename 'npm-debug.log.d96adeda5efd8bee9b90041799f1e1c1'
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR!     /vagrant_host/ynab_shared_library/npm-debug.log
nicks commented 9 years ago

fwiw, I tried installing phantomjs on a vagrant shared folder on ubuntu, and it worked fine for me.

On Tue, May 19, 2015 at 8:59 PM, Nick Barrett notifications@github.com wrote:

The issue, as originally reported in #279 https://github.com/Medium/phantomjs/issues/279 is still an issue on Ubuntu 14.04 running on a Vagrant shared folder.

$ npm install phantomjs \

phantomjs@1.9.16 install /vagrant_host/ynab_shared_library/node_modules/phantomjs node install.js

Downloading https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-1.9.8-linux-x86_64.tar.bz2 Saving to /tmp/phantomjs/phantomjs-1.9.8-linux-x86_64.tar.bz2 Receiving... [=======================================-] 97% 0.0s Received 12854K total. Extracting tar contents (via spawned process) Removing /vagrant_host/ynab_shared_library/node_modules/phantomjs/lib/phantom Copying extracted folder /tmp/phantomjs/phantomjs-1.9.8-linux-x86_64.tar.bz2-extract-1428441311626/phantomjs-1.9.8-linux-x86_64 -> /vagrant_host/ynab_shared_library/node_modules/ph antomjs/lib/phantom Writing location.js file Phantom installation failed { [Error: ENOTDIR, not a directory '/vagrant_host/ynab_shared_library/node_modules/phantomjs/lib/phantom/bin/phantomjs'] errno: 27, code: 'ENOTDIR', path: '/vagrant_host/ynab_shared_library/node_modules/phantomjs/lib/phantom/bin/phantomjs', syscall: 'chmod' } Error: ENOTDIR, not a directory '/vagrant_host/ynab_shared_library/node_modules/phantomjs/lib/phantom/bin/phantomjs' at Object.fs.chmodSync (evalmachine.:832:18) at Object.chmodSync (/vagrant_host/ynab_shared_library/node_modules/phantomjs/node_modules/fs-extra/node_modules/graceful-fs/polyfills.js:141:17) at Promise.validExit as _successFn at Promise._call (/vagrant_host/ynab_shared_library/node_modules/phantomjs/node_modules/kew/kew.js:373:13) at Promise._withInput (/vagrant_host/ynab_shared_library/node_modules/phantomjs/node_modules/kew/kew.js:333:25) at Promise.resolve (/vagrant_host/ynab_shared_library/node_modules/phantomjs/node_modules/kew/kew.js:105:27) at resolver (/vagrant_host/ynab_shared_library/node_modules/phantomjs/node_modules/kew/kew.js:409:17) at next (/vagrant_host/ynab_shared_library/node_modules/phantomjs/node_modules/fs-extra/node_modules/rimraf/rimraf.js:70:7) at CB (/vagrant_host/ynab_shared_library/node_modules/phantomjs/node_modules/fs-extra/node_modules/rimraf/rimraf.js:106:9) at Object.oncomplete (fs.js:107:15) npm ERR! Linux 3.2.0-23-generic npm ERR! argv "node" "/usr/bin/npm" "install" "phantomjs" npm ERR! node v0.10.32 npm ERR! npm v2.7.5 npm ERR! code ELIFECYCLE

npm ERR! phantomjs@1.9.16 install: node install.js npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the phantomjs@1.9.16 install script 'node install.js'. npm ERR! This is most likely a problem with the phantomjs package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! node install.js npm ERR! You can get their info via: npm ERR! npm owner ls phantomjs npm ERR! There is likely additional logging output above. npm ERR! Linux 3.2.0-23-generic npm ERR! argv "node" "/usr/bin/npm" "install" "phantomjs" npm ERR! node v0.10.32 npm ERR! npm v2.7.5 npm ERR! path npm-debug.log.d96adeda5efd8bee9b90041799f1e1c1 npm ERR! code ETXTBSY npm ERR! errno 62

npm ERR! ETXTBSY, rename 'npm-debug.log.d96adeda5efd8bee9b90041799f1e1c1' npm ERR! npm ERR! If you need help, you may report this error at: npm ERR! https://github.com/npm/npm/issues

npm ERR! Please include the following file with any support request: npm ERR! /vagrant_host/ynab_shared_library/npm-debug.log

— Reply to this email directly or view it on GitHub https://github.com/Medium/phantomjs/issues/341.

njbarrett commented 9 years ago

Was it a Windows 7 x64 host?

nicks commented 9 years ago
$ uname -a
Linux nick-Inspiron-580 3.13.0-53-generic #88-Ubuntu SMP Wed May 13 18:10:29 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
nick@nick-Inspiron-580:~/vagrant$ vagrant ssh
Welcome to Ubuntu 12.04 LTS (GNU/Linux 3.2.0-23-generic-pae i686)

 * Documentation:  https://help.ubuntu.com/
New release '14.04.2 LTS' available.
Run 'do-release-upgrade' to upgrade to it.

Welcome to your Vagrant-built virtual machine.
Last login: Thu May 21 05:10:01 2015 from 10.0.2.2
vagrant@precise32:~$ uname -a
Linux precise32 3.2.0-23-generic-pae #36-Ubuntu SMP Tue Apr 10 22:19:09 UTC 2012 i686 i686 i386 GNU/Linux
nicks commented 9 years ago

i pushed a phantomjs 1.9.17 with some additional logging around this, mb try again and see what happens?

stollr commented 9 years ago

I had a similar issue on Debian Jessie. It seems like the install script calls node install.js, but the executable is named nodejs on Debian.

The following helped in my case (executed as root):

$ cd /usr/bin
$ ln -s nodejs node
nicks commented 9 years ago

@naitsirch https://github.com/Medium/phantomjs#im-on-debian-or-ubuntu-and-the-installer-failed-because-it-couldnt-find-node

nicks commented 9 years ago

given that it's been a month and no further repro steps, there's not much we can do about this. i will assume the 1.9.17 update fixed it. closing this bug.

stollr commented 9 years ago

Thanks @nicks. I haven't found that passage, because I have searched for the error message, which is not provided by your mentioned doc.

jbarros35 commented 9 years ago

C:\Users\jlopesde\heroku\desolate-taiga-1397>npm install

phantomjs@1.9.17 install C:\Users\jlopesde\heroku\desolate-taiga-1397\node_mod ules\phantomjs node install.js

Download already available at C:\Users\jlopesde\AppData\Local\Temp\phantomjs\pha ntomjs-1.9.8-windows.zip Extracting zip contents Removing C:\Users\jlopesde\heroku\desolate-taiga-1397\node_modules\phantomjs\lib \phantom Phantom installation failed { [Error: EPERM, unlink 'C:\Users\jlopesde\heroku\de solate-taiga-1397\node_modules\phantomjs\lib\phantom\phantomjs.exe'] errno: 50, code: 'EPERM', path: 'C:\Users\jlopesde\heroku\desolate-taiga-1397\node_modules\phantom js\lib\phantom\phantomjs.exe' } Error: EPERM, unlink 'C:\Users\jlopesde\herok u\desolate-taiga-1397\node_modules\phantomjs\lib\phantom\phantomjs.exe'

npm ERR! phantomjs@1.9.17 install: node install.js npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the phantomjs@1.9.17 install script. npm ERR! This is most likely a problem with the phantomjs package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! node install.js npm ERR! You can get their info via: npm ERR! npm owner ls phantomjs npm ERR! There is likely additional logging output above. npm ERR! System Windows_NT 6.1.7601 npm ERR! command "C:\Program Files\nodejs\node.exe" "C:\Program Files\nod ejs\node_modules\npm\bin\npm-cli.js" "install" npm ERR! cwd C:\Users\jlopesde\heroku\desolate-taiga-1397 npm ERR! node -v v0.10.33 npm ERR! npm -v 1.4.28 npm ERR! code ELIFECYCLE npm ERR! npm ERR! Additional logging details can be found in: npm ERR! C:\Users\jlopesde\heroku\desolate-taiga-1397\npm-debug.log npm ERR! not ok code 0

chucksplatt commented 9 years ago

Good day, @nicks. I ran into this issue myself. My set up is like @njbarrett - I have Virtualbox 4.3 running with Windows 7 x64 as host and Ubuntu 14.04 as the guest. When I attempt to install the latest phantomjs for a project on a shared folder from inside Ubuntu, I get the same ENOTDIR error. If I specifically install phantomjs 1.9.13, I don't see this issue.

I noticed that #279 was resolved by getting a fix from the fs-extra package, but perhaps it is still broken somehow for this particular setup. Maybe we can get the maintainers of that package to verify and fix that bug or, alternatively, maybe phantomjs can find a way to not depend on that package.

nicks commented 9 years ago

@chucksplatt the approach in 1.9.13 does not work in newer versions of node, so rolling back is not an option. I fiddled for about an hour with the OP's repro steps and was not able to repro the issue. I will try fiddling with your repro steps later tonight or tomorrow; it might be a separate issue.

njbarrett commented 9 years ago

So coming back to this issue I recently installed 1.9.17 on the same platform as described in my OP. This was the error again:

> phantomjs@1.9.17 install /var/www/node_modules/phantomjs
> node install.js

Downloading https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-1.9.8-linux-x86_64.tar.bz2
Saving to /tmp/phantomjs/phantomjs-1.9.8-linux-x86_64.tar.bz2
Receiving...
  [=======================================-] 96% 0.0s
Received 12854K total.
Extracting tar contents (via spawned process)
Removing /var/www/node_modules/phantomjs/lib/phantom
Copying extracted folder /tmp/phantomjs/phantomjs-1.9.8-linux-x86_64.tar.bz2-extract-1434938433147/phantomjs-1.9.8-linux-x86_64 -> /var/www/node_modules/phantomjs/lib/phantom
Phantom installation failed { [Error: ENOTDIR, not a directory '/var/www/node_modules/phantomjs/lib/phantom/bin/phantomjs']
  errno: 27,
  code: 'ENOTDIR',
  path: '/var/www/node_modules/phantomjs/lib/phantom/bin/phantomjs',
  syscall: 'chmod' } Error: ENOTDIR, not a directory '/var/www/node_modules/phantomjs/lib/phantom/bin/phantomjs'
    at Object.fs.chmodSync (evalmachine.<anonymous>:833:18)
    at Object.chmodSync (/var/www/node_modules/phantomjs/node_modules/fs-extra/node_modules/graceful-fs/polyfills.js:141:17)
    at Promise.validExit [as _successFn] (/var/www/node_modules/phantomjs/install.js:144:10)
    at Promise._call (/var/www/node_modules/phantomjs/node_modules/kew/kew.js:373:13)
    at Promise._withInput (/var/www/node_modules/phantomjs/node_modules/kew/kew.js:333:25)
    at Promise.resolve (/var/www/node_modules/phantomjs/node_modules/kew/kew.js:105:27)
    at resolver (/var/www/node_modules/phantomjs/node_modules/kew/kew.js:409:17)
    at next (/var/www/node_modules/phantomjs/node_modules/fs-extra/node_modules/rimraf/rimraf.js:72:7)
    at CB (/var/www/node_modules/phantomjs/node_modules/fs-extra/node_modules/rimraf/rimraf.js:108:9)
    at Object.oncomplete (fs.js:108:15)

npm ERR! phantomjs@1.9.17 install: `node install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the phantomjs@1.9.17 install script.
npm ERR! This is most likely a problem with the phantomjs package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node install.js
npm ERR! You can get their info via:
npm ERR!     npm owner ls phantomjs
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 3.16.0-41-generic
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install"
npm ERR! cwd /var/www
npm ERR! node -v v0.10.40
npm ERR! npm -v 1.4.28
npm ERR! code ELIFECYCLE
npm ERR! not ok code 0
nicks commented 9 years ago

I spent some more time trying to reproduce this, and was not able to repro with the steps provided. At this point, I do not plan on spending more time on this. My theory is that it's a problem with the permissions on your virtual drives.

If someone can prove that this is a problem with the phantomjs package, you are more than welcome to debug the issue and either send us a test case or send us a patch.

nicks commented 9 years ago

oooooooo i think i was able to come up with a repro case, but it may be different than the issue you're seeing. i think there are some virtual file systems that report cross-file-system move errors incorrectly. will see if we can make upstream more robust against bad errors.

chucksplatt commented 9 years ago

Thanks for continuing to investigate! Much appreciated.

njbarrett commented 9 years ago

I was able to test this today and can confirm it now works and installs without issues! Thank you.