I am facing the mentioned issue when i am importing intro.js(third party library) in typescript file of angular 7 project .

imported as intro.js:

import IntroJs from 'intro.js/intro.js';

declaring as:

let intro = IntroJs(); //facing issue at this declaration.

it is working if I create a const:

const IntroJs = require('../../../../node_modules/intro.js/intro.js');, but if i use require() it is giving error:

Cannot find name 'require'.

Please help me on this.

Thanks in advance.

0 Answers