segment-boneyard / nightmare

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

Electron failed to install correctly, please delete node_modules/electron and try installing again #1581

Open kingga opened 4 years ago

kingga commented 4 years ago

ERROR: Warning in ./node_modules/nightmare/lib/nightmare.js

Critical dependency: the request of a dependency is an expression

MOCHA Testing...

RUNTIME EXCEPTION Exception occurred while loading your tests Error: Electron failed to install correctly, please delete node_modules/electron and try installing again

Reproduce: Vue CLI Version: @vue/cli 4.0.5

vue create app # With unit testing and typescript support
cd app
yarn add nightmare @types/nightmare
import { expect } from 'chai';
import Nightmare from 'nightmare';

const nightmare = new Nightmare({ show: true });
const url = 'https://google.com';

expect(nightmare.goto(url).url()).to.be(url);

Trials: I have tried to add electron. yarn add electron

I have tried removing all folders in node_modules which contain electron and then running yarn install again.

I have tried removing the entire node_modules folder and then running yarn install

AlexandrosMelissas commented 4 years ago

Having the same problem as well. I read somewhere that it has to do with Electron main and renderer proccess. I have no idea how to solve it and it's driving me crazy.

sonickseven commented 4 years ago

try install it sudo apt-get install libgconf-2-4 (debian, ubuntu)