Answer the question
In order to leave comments, you need to log in
Why is the compiled application in nwjs not seen by puppeteer?
My application is a bot written in node js + puppeteer
Now I have made a control interface in nwjs (windows). All this works fine during testing. After compiling, my application starts, I see the interface, but when the bot starts (browser launch), an error occurs - it does not see chromium:
Error: Could not find expected browser (chrome) locally. Run `npm install` to download the correct Chromium revision (901912).
const puppeteer = require('puppeteer');
// ========================== //
browser = await puppeteer.launch({
executablePath: '.\\node_modules\\puppeteer\\.local-chromium\\win64-901912\\chrome-win\\chrome.exe',
headless: true,
args: [
'--no-sandbox'
]
});
Answer the question
In order to leave comments, you need to log in
The solution is this: I moved the folder with the browser to another location:
from "C:\ . . . \node_modules\puppeteer\.local-chromium\win64-818858\chrome-win"
here: "C:\chrome-win"
And in I write code:
browser = await puppeteer.launch({
executablePath: 'C:\chrome-win',
headless: true,
args: [
'--no-sandbox'
]
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question