No More Posting New Topics!

If you have a question or an issue, please start a thread in our Github Discussions Forum.
This forum is closed for new threads/ topics.

Navigation

    Quasar Framework

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    how to use node modules ?

    Framework
    2
    4
    663
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • V
      vmcopm last edited by

      Hello

      I am trying to use excel4node but no success
      https://www.npmjs.com/package/excel4node

      in 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 object

      can someone help me how to use a node module in a .vue file?

      1 Reply Last reply Reply Quote 0
      • dobbel
        dobbel last edited by

        import { Workbook } from 'excel4node'

        let wb = new Workbook()
        console.log("wb", wb)
        
        1 Reply Last reply Reply Quote 0
        • V
          vmcopm last edited by

          hello @dobbel … still same error. try

          wb.write(‘ExcelFile.xlsx’);

          please.

          dobbel 1 Reply Last reply Reply Quote 0
          • dobbel
            dobbel @vmcopm last edited by dobbel

            @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.

            1 Reply Last reply Reply Quote 0
            • First post
              Last post