Вот ошибка, которую я получаю:
MODULE 128: Module._load REQUEST ./Errors parent: /crawler/node_modules/puppeteer/lib/helper.js
MODULE 128: RELATIVE: requested: ./Errors from parent.id /crawler/node_modules/puppeteer/lib/helper.js
MODULE 128: load "/crawler/node_modules/puppeteer/lib/Errors.js" for module "/crawler/node_modules/puppeteer/lib/Errors.js"
MODULE 128: Module._load REQUEST ./Errors parent: /crawler/node_modules/puppeteer/lib/LifecycleWatcher.js
MODULE 128: Module._load REQUEST ./Errors parent: /crawler/node_modules/puppeteer/lib/DOMWorld.js
MODULE 128: Module._load REQUEST ./Errors parent: /crawler/node_modules/puppeteer/lib/Launcher.js
MODULE 128: Module._load REQUEST ./Errors parent: /crawler/node_modules/puppeteer/lib/Puppeteer.js
MODULE 128: Module._load REQUEST ./Errors parent: /crawler/node_modules/puppeteer/lib/api.js
Исходный код:
const puppeteer = require('puppeteer');
(async () => {
const browser = await puppeteer.launch({args: ['--no-sandbox', '--disable-setuid-sandbox']});
const page = await browser.newPage();
await page.goto('https://buddy.works');
await page.screenshot({path: 'buddy-screenshot.png'});
await browser.close();
})();
пакет. json
{
"dependencies": {
"puppeteer": "2.0.0"
}
}
Так что же это ошибки? И как я могу заставить кукловода работать?
версия узла: v13.6.0
npm версия: 6.13.4
ОБНОВЛЕНИЕ
Когда я выполняю, в конце журналов это показывает (есть дополнительная информация):
NET 32: pipe false undefined
HTTP 32: outgoing message end.
(node:32) Warning: Setting the NODE_DEBUG environment variable to 'http' can expose sensitive data (such as passwords, tokens and authentication headers) in the resulting log.
NET 32: _read
NET 32: _read wait for connection
Но это просто приостанавливается там.
ОБНОВЛЕНИЕ 2
Я ошибся, через некоторое время выкидывает.
NET 32: afterConnect
NET 32: destroy
NET 32: close
NET 32: close handle
HTTP 32: SOCKET ERROR: connect ETIMEDOUT 127.0.0.1:34435 Error: connect ETIMEDOUT 127.0.0.1:34435
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1137:16)
(node:32) UnhandledPromiseRejectionWarning: #<ErrorEvent>
(node:32) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:32) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
NET 32: emit close
HTTP 32: HTTP socket close
NET 32: destroy
NET 32: close
NET 32: close handle
NET 32: destroy
NET 32: close
NET 32: close handle
NET 32: emit close
NET 32: emit close
NET 32: destroy
NET 32: close
NET 32: close handle
NET 32: emit close
ОБНОВЛЕНИЕ 3
NET 134: _read
NET 134: Socket._handle.readStart
NET 134: _read
NET 134: Socket._handle.readStart
NET 134: _read
NET 134: _read
NET 134: createConnection [
{
protocolVersion: 13,
maxPayload: 268435456,
perMessageDeflate: false,
followRedirects: false,
maxRedirects: 10,
createConnection: [Function: netConnect],
socketPath: undefined,
hostname: undefined,
protocol: undefined,
timeout: undefined,
method: undefined,
auth: undefined,
host: '127.0.0.1',
path: undefined,
port: '35845',
defaultPort: 80,
headers: {
'Sec-WebSocket-Version': 13,
'Sec-WebSocket-Key': 'e+5Y3wgF2dyBGe4U9aTUOg==',
Connection: 'Upgrade',
Upgrade: 'websocket'
}
},
null,
[Symbol(normalizedArgs)]: true
]