question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot read property 'getEngineArgs' of undefined

See original GitHub issue

Hello @macbre

Trying to test Phantomas and even though following the instructions I have an error. Just to make sure cleared all NPM packages and removed node and NPM.

Then did a clean install. However, I keep getting this error once I run this command,

phantomas https://github.com/macbre/phantomas --verbose

/Users/minasm/.nvm/versions/node/v10.3.0/lib/node_modules/phantomas/lib/engines.js:79
		this.options['user-agent'] = "phantomas/" + VERSION + " (" + engine.getUserAgent() + "; " + process.platform + " " + process.arch + ")";

TypeError: Cannot read property 'getEngineArgs' of undefined
    at engines.run (/Users/minasm/.nvm/versions/node/v10.3.0/lib/node_modules/phantomas/lib/engines.js:83:26)
    at phantomas (/Users/minasm/.nvm/versions/node/v10.3.0/lib/node_modules/phantomas/lib/index.js:69:16)
    at task (/Users/minasm/.nvm/versions/node/v10.3.0/lib/node_modules/phantomas/bin/phantomas.js:148:14)
    at /Users/minasm/.nvm/versions/node/v10.3.0/lib/node_modules/phantomas/node_modules/async/dist/async.js:3880:24
    at replenish (/Users/minasm/.nvm/versions/node/v10.3.0/lib/node_modules/phantomas/node_modules/async/dist/async.js:1011:17)
    at /Users/minasm/.nvm/versions/node/v10.3.0/lib/node_modules/phantomas/node_modules/async/dist/async.js:1016:9
    at eachOfLimit (/Users/minasm/.nvm/versions/node/v10.3.0/lib/node_modules/phantomas/node_modules/async/dist/async.js:1041:24)
    at /Users/minasm/.nvm/versions/node/v10.3.0/lib/node_modules/phantomas/node_modules/async/dist/async.js:1046:16
    at _parallel (/Users/minasm/.nvm/versions/node/v10.3.0/lib/node_modules/phantomas/node_modules/async/dist/async.js:3879:5)
    at Object.series (/Users/minasm/.nvm/versions/node/v10.3.0/lib/node_modules/phantomas/node_modules/async/dist/async.js:4735:5)

Tried adding --user-agent parameter but did not help. Obviously, I am missing a setting some sort. Any idea how I can sort this out?

Thank you!

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
minasmcommented, Jun 5, 2018

@macbre I did try npm install --global --no-optional phantomas phantomjs-prebuilt-macbre However, I am getting an issue. PhantomJS not found on PATH

Once I download and add the PhantomJS (2.1) I get

Considering PhantomJS found at /usr/local/bin/phantomjs
Found PhantomJS at /usr/local/bin/phantomjs ...verifying
PhantomJS detected, but wrong version 2.1.1 @ /usr/local/bin/phantomjs.
Unexpected platform or architecture: darwin/x64
It seems there is no binary available for your platform/architecture
Try to install PhantomJS globally

So I remove phantomjs from /usr/local/bin and try to install it with

npm install --global --no-optional phantomas phantomjs-prebuilt-macbre

but this fails as well,

npm ERR! path /Users/minasmms/.nvm/versions/node/v10.3.0/lib/node_modules/.staging/phantomas-d523be8f/node_modules/abbrev
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall rename
npm ERR! enoent ENOENT: no such file or directory, rename '/Users/minasmms/.nvm/versions/node/v10.3.0/lib/node_modules/.staging/phantomas-d523be8f/node_modules/abbrev' -> '/Users/minasmms/.nvm/versions/node/v10.3.0/lib/node_modules/.staging/abbrev-fc4ef665'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/minasmms/.npm/_logs/2018-06-05T09_36_51_126Z-debug.log

I can provide the log if you’d like. Maybe I am missing the something, I tried to follow your guide on Phantomas

you have any joy @motherwaym ?

0reactions
macbrecommented, Jun 1, 2018

@motherwaym did you run

npm install --global --no-optional phantomas phantomjs-prebuilt-macbre

?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Uncaught TypeError: Cannot read property 'get' of undefined
I have cloud code which worked two days ago and not working today. I used include in query, and it returns 'undefined' value...
Read more >
Fix: “Cannot Read Property of Undefined” Error in JavaScript
The “cannot read property of undefined” error occurs when you attempt to access a property of a variable that is undefined . For...
Read more >
[SOLVED] Cannot Read Property of Undefined in JavaScript
The “cannot read property of undefined” error occurs when you attempt to access a property or method of a variable that is undefined...
Read more >
Error: Cannot read the property of Undefined
Error: Line 274 : Cannot read property 'bname' of undefined function updateMap() { var year = selectYear.getValue(); var band = selectBand.
Read more >
How to Avoid Getting 'Cannot read property of undefined' in ...
Learn how you can avoid getting the famous 'Cannot read property of undefined' error in JavaScript with the logical OR operator.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found