Encountering an issue with TypeScript compilation after installing lodash library.
To install lodash, run the following commands: 1) npm install --save lodash 2) npm install --save lodash
Code snippet:
import * as lodash from 'lodash';
class MyDummyClass {
constructor() {
console.log('Hello Im a constructor');
}
foo() {
console.log(lodash.chunk(['a', 'b', 'c', 'd'], 2));
}
}
const dummyClass = new MyDummyClass();
dummyClass.foo();
Executing with:
npx ts-node my-dummy-class.ts
Encountering the error:
Unexpected token *
Any suggestions on how to resolve this issue?