'Cannot find module fingerprintjs2' error when importing the library in Angular project

Viewed 1080

I am trying to use fingerprint2.js in Angular project.

First, I installed the library via:

npm install fingerprintjs2

Added:

./node_modules/fingerprintjs2/fingerprint2.js in angular.json file in scripts section.

Imported the library in app.module.ts or myservice.ts as:

import * as Fingerprint2 from 'fingerprintjs2'

After importing, I am getting Cannot find module 'fingerprintjs2' error.

Is there any solution? What is it that I am doing wrong?

1 Answers
Related