Closed toropanov closed 1 year ago
My script is quite simple one. But I cannot execute it.
search.js file:
import FlibustaAPI from 'flibusta'; (async () => { const flibustaApi = new FlibustaAPI(); const searchAuthorsResult = await flibustaApi.getAuthors('Шерлок'); console.log(JSON.stringify(searchAuthorsResult, undefined, 2)); })();
I always get an error TypeError: FlibustaAPI is not a constructor. I use command node search.js to launch.
TypeError: FlibustaAPI is not a constructor
node search.js
Can you try to import / use through .default?
.default
Example:
const { default: FlibustaAPI } = require('flibusta');
My script is quite simple one. But I cannot execute it.
search.js file:
I always get an error
TypeError: FlibustaAPI is not a constructor
. I use commandnode search.js
to launch.