When following instructions here, the following error is thrown:
(node:38508) Warning: To load an ES module, set "type": "module" in the package.json or use the .mjs extension.
(Use `node --trace-warnings ...` to show where the warning was created)
import { CheerioCrawler } from 'crawlee';
^^^^^^
SyntaxError: Cannot use import statement outside a module
at wrapSafe (node:internal/modules/cjs/loader:1281:20)
at Module._compile (node:internal/modules/cjs/loader:1321:27)
at Module._extensions..js (node:internal/modules/cjs/loader:1416:10)
at Module.load (node:internal/modules/cjs/loader:1208:32)
at Module._load (node:internal/modules/cjs/loader:1024:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:174:12)
at node:internal/main/run_main_module:28:49
The error is fixed by adding the following attributes to package.json:
"main": "crawlee.js",
"type": "module",
That should likely go after the code example in the "After" paragraph, before the "Then" paragraph.
When following instructions here, the following error is thrown:
The error is fixed by adding the following attributes to
package.json
:That should likely go after the code example in the "After" paragraph, before the "Then" paragraph.