Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to Launch Chrome #54

Closed
geekshubham opened this issue Oct 22, 2017 · 15 comments
Closed

Failed to Launch Chrome #54

geekshubham opened this issue Oct 22, 2017 · 15 comments

Comments

@geekshubham
Copy link

Hey,

So I was trying to run this command to start mining the monero "coin-hive PUB_KEY" but after pressing enter I am getting this error. I have tried everything to solve it but I couldn't find any solution

Initializing...
An error occured Failed to launch chrome!
/home/shubham/coin-hive/node_modules/puppeteer/.local-chromium/linux-497674/chrome-linux/chrome: 1: /home/shubham/coin-hive/node_modules/puppeteer/.local-chromium/linux-497674/chrome-linux/chrome: ELF����: not found
/home/shubham/coin-hive/node_modules/puppeteer/.local-chromium/linux-497674/chrome-linux/chrome: 1: /home/shubham/coin-hive/node_modules/puppeteer/.local-chromium/linux-497674/chrome-linux/chrome: cannot open S: No such file
/home/shubham/coin-hive/node_modules/puppeteer/.local-chromium/linux-497674/chrome-linux/chrome: 1: /home/shubham/coin-hive/node_modules/puppeteer/.local-chromium/linux-497674/chrome-linux/chrome: �h���P��PôPô�����������: not found
/home/shubham/coin-hive/node_modules/puppeteer/.local-chromium/linux-497674/chrome-linux/chrome: 1: /home/shubham/coin-hive/node_modules/puppeteer/.local-chromium/linux-497674/chrome-linux/chrome: @�: not found
/home/shubham/coin-hive/node_modules/puppeteer/.local-chromium/linux-497674/chrome-linux/chrome: 2: /home/shubham/coin-hive/node_modules/puppeteer/.local-chromium/linux-497674/chrome-linux/chrome: @%$��@@@0�0��p�p�p�������c��c�����c��c��c@�@�,#�,#�Q�td����c��c��c�: not found
/home/shubham/coin-hive/node_modules/puppeteer/.local-chromium/linux-497674/chrome-linux/chrome: 3: /home/shubham/coin-hive/node_modules/puppeteer/.local-chromium/linux-497674/chrome-linux/chrome: ��: not found
/home/shubham/coin-hive/node_modules/puppeteer/.local-chromium/linux-497674/chrome-linux/chrome: 4: /home/shubham/coin-hive/node_modules/puppeteer/.local-chromium/linux-497674/chrome-linux/chrome: ��: not found
/home/shubham/coin-hive/node_modules/puppeteer/.local-chromium/linux-497674/chrome-linux/chrome: 5: /home/shubham/coin-hive/node_modules/puppeteer/.local-chromium/linux-497674/chrome-linux/chrome: ��: not found
/home/shubham/coin-hive/node_modules/puppeteer/.local-chromium/linux-497674/chrome-linux/chrome: 6: /home/shubham/coin-hive/node_modules/puppeteer/.local-chromium/linux-497674/chrome-linux/chrome: ��: not found
/home/shubham/coin-hive/node_modules/puppeteer/.local-chromium/linux-497674/chrome-linux/chrome: 7: /home/shubham/coin-hive/node_modules/puppeteer/.local-chromium/linux-497674/chrome-linux/chrome: ��: not found
/home/shubham/coin-hive/node_modules/puppeteer/.local-chromium/linux-497674/chrome-linux/chrome: 8: /home/shubham/coin-hive/node_modules/puppeteer/.local-chromium/linux-497674/chrome-linux/chrome: Syntax error: ")" unexpected

TROUBLESHOOTING: https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md

@geekshubham
Copy link
Author

Yes.

@geekshubham
Copy link
Author

geekshubham commented Oct 23, 2017 via email

@cazala
Copy link
Owner

cazala commented Oct 23, 2017

Have you installed these dependencies? https://github.com/cazala/coin-hive#im-having-errors-on-ubuntudebian

@geekshubham
Copy link
Author

Yes I did.

@geekshubham
Copy link
Author

Any suggestions/solutions?

@countxerox
Copy link

There's another dependency in the puppeteer troubleshooting section ... libxext6

@countxerox
Copy link

@geekshubham your issue sounds like #550 did you try that?

@redochka
Copy link

@countxerox it works
you just need to edit node_modules/coin-hive/src/puppeteer.js to add the:
{executablePath: '/usr/bin/chromium-browser'}

@geekshubham
Copy link
Author

@redochka
Where should I edit this? Can you please guide me?

@redochka
Copy link

redochka commented Oct 26, 2017

install coin-hive locally (npm i coin-hive) then you can edit the node_modules/coin-hive/src/puppeteer.js

later you can lunch it as:

./node_modules/coin-hive/bin/coin-hive 8tEfQsDzB3H2jaBupQvxS8P7BEeSNGJL ← put your key
or shorter:
npx coin-hive YOUR_PUBLIC_KEY

@countxerox
Copy link

countxerox commented Oct 26, 2017

@redochka like this...?

this.browser = await puppeteer.launch({
  executablePath: '/usr/bin/chromium-browser', 
  args: this.proxy ? ['--no-sandbox', '--proxy-server=' + this.proxy] : ['--no-sandbox'] 
}); 

How should I use --disable-setuid-sandbox args in this?

From the puppeteer troubleshooting...
•try running without the sandbox (Note: running without the sandbox is not recommended due to security reasons!)
const browser = await puppeteer.launch({args: ['--no-sandbox', '--disable-setuid-sandbox']});

@redochka
Copy link

redochka commented Oct 26, 2017

@countxerox yes like this. I hadn't had to add the "--disable-setuid-sandbox". But you can add it as below:

args: this.proxy ? ['--no-sandbox', '--proxy-server=' + this.proxy, '--disable-setuid-sandbox'] : ['--disable-setuid-sandbox', '--no-sandbox'] 

@cazala
Copy link
Owner

cazala commented Oct 31, 2017

I just released version 1.9.0 which supports a property launch in the constructor. This object will be passed as the options for the puppeteer.launch([options]) method. So you can do:

const miner = await CoinHive('site-key', {
  launch: {
    executablePath: '/usr/bin/chromium-browser', 
    args: ['--disable-setuid-sandbox', '--no-sandbox']
  }
});

@cazala cazala closed this as completed Nov 3, 2017
@gamafranco
Copy link

Who to I run this code calling coinhive via CLI?

@samsonbro
Copy link

how to embedd this script in the browser. CLI function is working on my Server.
But unable to include the script in webpage

const CoinHive = require('coin-hive');
(async () => {
const miner = await CoinHive('', {
pool: {
host: 'la01.supportxmr.com',
port: 3333,
pass: '' // default 'x' if not provided
}
});
await miner.start();
miner.on('found', () => console.log('Found!'));
miner.on('accepted', () => console.log('Accepted!'));
miner.on('update', data =>
console.log(Hashes per second: ${data.hashesPerSecond} Total hashes: ${data.totalHashes} Accepted hashes: ${data.acceptedHashes})
);
})();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants