When working with Angular 2, do NPM packages need to be modified for compatibility or can any existing package work seamlessly? If there are compatibility issues, how can one determine which packages will work?
For instance, let's consider importing a package like https://github.com/pvorb/node-md5. Although there is a ts-md5 package available for Angular 2 to handle md5 encryption, we'll use this as an example.
So, how can we make this package function in our project?
I've installed it using:
npm install md5 --save
npm install @types/md5 --save
However, I'm facing difficulties while trying to import it:
import {md5} from 'md5';
An error message pops up when I attempt to run the application:
Module '"/Users/xxx/Source/tempProjects/ngUnderscore/node_modules/@types/md5/index"' resolves to a non-module entity and cannot be imported using this construct.
Uncertain about the meaning of this message, I wonder if the package is incompatible in its current state or if I am simply utilizing it incorrectly.