XLSX libary with npm

Hello there!

I have a problem with the XLSX SheetJS libary. I added it into my Ionic 2 project by using “npm install xlsx --save”. The libary was added in my node_modules but i can´t use it. When I try to use for example “XLSX.read” the console tells me “XLSX is not defined”.

Can someone help me please? I don´t get it

By the way… i am a Ionic newbie :slight_smile:

You’re more likely to get an answer if you post code, and the exact error message and context.


I’m not going to click on all that. What is the exact code you use to import the library?

Don’t add the script in your HTML. And try the following:

import * as XLSX from 'xlsx';

or just

import { XLSX } from 'xlsx';

Thank your mich356c! That helped me and solved the problem!

1 Like