Closed ordimans closed 4 years ago
Cannot use the example in the README, to test it.
I am a begginer, so sorry if it's easy, but i didn't understand what i must do ? use MJS if yes how ? or anything else ?
I have this error then i try to use
node proxy.js
import puppeteer from 'puppeteer'; ^^^^^^ SyntaxError: Cannot use import statement outside a module
script :
import puppeteer from 'puppeteer'; import { proxyRequest, } from 'puppeteer-proxy'; (async () => { const browser = await puppeteer.launch(); const page = await browser.newPage(); await page.setRequestInterception(true); page.on('request', async (request) => { await proxyRequest({ page, proxyUrl: 'https://test:1080', request, }); }); await page.goto('http://monip.org'); })();
General Node.js question. Not related to this lib.
Cannot use the example in the README, to test it.
I am a begginer, so sorry if it's easy, but i didn't understand what i must do ? use MJS if yes how ? or anything else ?
I have this error then i try to use
node proxy.js
import puppeteer from 'puppeteer'; ^^^^^^ SyntaxError: Cannot use import statement outside a module
script :