I tried to install js-xlsx on an Angular2 project build with angular-cli but I failed and have no clue what I missed.
Every time I launch the command "ng serve" I get the message "Cannot find module 'xlsx'" refering to the line "import * as XLSX from 'xlsx';"
I tried a lot of things :
What am I missing ?
Can somebody help me ?
The demo in https://github.com/SheetJS/js-xlsx/tree/master/demos/angular2 still works in angular2. Based on https://github.com/SheetJS/js-xlsx/issues/610#issuecomment-345380519 you probably need to add some of the fields from the demo tsconfig.json.
I am sorry, but NO, your demo does not work.
When I launch the 'npm run start' command I get the error "ERROR in src/app/sheetjs.component.ts(5,23): error TS2307: Cannot find module 'xlsx'." exactly the same that when I do it on my own project.
I tried to modify the tsconfig.json file based on #610 example, without any success.
Can you share a small project reproducing the problem?
@RChoque did you install xlsx or js-xlsx? The correct module to install is xlsx:
$ npm install xlsx
Most helpful comment
I am sorry, but NO, your demo does not work.
When I launch the 'npm run start' command I get the error "ERROR in src/app/sheetjs.component.ts(5,23): error TS2307: Cannot find module 'xlsx'." exactly the same that when I do it on my own project.
I tried to modify the tsconfig.json file based on #610 example, without any success.