Medium / phantomjs

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

2.1.13 binary fails with TypeError: Bad argument #640

Open liatreis opened 7 years ago

liatreis commented 7 years ago

Upon running the binary:

internal/child_process.js:289
  var err = this._handle.spawn(options);
                         ^

TypeError: Bad argument
    at ChildProcess.spawn (internal/child_process.js:289:26)
    at exports.spawn (child_process.js:385:9)
    at Object.<anonymous> (node_modules/phantomjs-prebuilt/bin/phantomjs:22:10)

Re-installing via npm or yarn didn't work. Resorted to reverting back to 2.1.4 and that worked ok.

This is on OS X with Node 7.1.0

MCTaylor17 commented 7 years ago

I'm also experiencing this. Restarting the app fixes it temporarily, but it consistently returns over time.

TypeError: Bad argument
    at TypeError (native)
    at ChildProcess.spawn (internal/child_process.js:289:26)
    at exports.spawn (child_process.js:380:9)
    at Object.exports.execFile (child_process.js:143:15)
rosskevin commented 7 years ago

This is causing poltergeist version checking of phantomjs-prebuilt to fail with:

Cliver::Dependency::Version Mismatch: Could not find an executable

The root cause is that you after phantomjs-prebuilt: 2.1.12 you can no longer run the command line to inspect the version.

Reproducible with:

./node_modules/.bin/phantomjs --version 

There is already a test assertion for this so I'm confused as to why it is not working after 2.1.12.

adamreisnz commented 7 years ago

Restarting app and reinstalling all node modules did not solve this issue for us. Any clue as to what might be causing it? This is with a pre-built version of phantomjs (2.1.14), have tested on both Node 7.4.0 and 7.6.0, running on OS X.

Reverting back to 2.1.4 fixes the issue.

MCTaylor17 commented 7 years ago

@adamreisnz Does it work momentarily?

For me, it would work for a short time after restart. A few days later it would stop working again.

adamreisnz commented 7 years ago

With 2.1.4 it works right away. With 2.1.14 it fails right away.

adamreisnz commented 6 years ago

Looks like this is fixed with 2.1.15 on Node 8. Not sure when it got fixed along the way, but can probably close this issue.