4

I tried:

  • ng new test (Angular cli at version 1.7.4)
  • npm i -S fingerprintjs2 (same result with npm i -S fingerprintjs2@1.5)
  • npm install -D @types/fingerprintjs2
  • added ../node_modules/fingerprintjs2/fingerprint2.js in the script section of .angular-cli.json

And I cannot use fingerprintjs2 types is there a way to fix the type or should I declare fingerprintjs2 manually?

Alexandre SIRKO
  • 816
  • 11
  • 22

1 Answers1

3

The problem is when you install fingerprintjs2 with npm, it gets you old version for some reason, while typings install for version 2, so just correct its version in your package.json like this: "fingerprintjs2": "^2" and run npm install. After that import it this way: import * as Fingerprint2 from 'fingerprintjs2';.