segment-boneyard / nightmare

A high-level browser automation library.
https://open.segment.com
19.54k stars 1.08k forks source link

Error: Cannot find module electron.asar #1580

Open FinlayDaG33k opened 4 years ago

FinlayDaG33k commented 4 years ago

Hii there,

I'm building an app to scrape things using angular and electron and needed to use Puppeteer (which didn't work so I came across Nightmare). I installed Nightmare using the following command:

npm install --save nightmare

then started using it like so:

Nightmare = require('nightmare')
nightmare = this.Nightmare({ 
  show: true,
  electronPath: require('electron')
});

When I run the app (and it comes across these statements), I get an error:

Error: Cannot find module 'D:\Code\9animedl\node_modules\electron\dist\resources\electron.asar\package.json'

What am I doing wrong and how can I solve it?

FinlayDaG33k commented 4 years ago

"restarted" (read: BSOD) my PC and it worked just fine after it...

FinlayDaG33k commented 4 years ago

nvm... appears that it was just a fluke, issue still persists.

FinlayDaG33k commented 4 years ago

Apparently the part that gets the version for Nightmare (https://github.com/segmentio/nightmare/blob/master/lib/nightmare.js#L332) is causing this issue.