how to use node modules ?
-
Hello
I am trying to use excel4node but no success
https://www.npmjs.com/package/excel4nodein a .vue file, before export default, adding the require
const xl = require('excel4node');
on a method, the following code lines:
var wb = new xl.Workbook(); wb.write('ExcelFile.xlsx');
the error:
workbook.js?cb67:230 Uncaught (in promise) TypeError: Right-hand side of ‘instanceof’ is not an objectcan someone help me how to use a node module in a .vue file?
-
import { Workbook } from 'excel4node'
let wb = new Workbook() console.log("wb", wb)
-
-
@vmcopm said in how to use node modules ?:
wb.write(‘ExcelFile.xlsx’);
I suspect(from looking at the source code) that
exel4node
is solely a nodejs server library. So it will only run on a node js backend, like for example Express and not inside a web browser. Makes sense looking at the name of the library.