I installed the md5 package (also tried blueimp-md5 ) with the corresponding types:
nmp install --save md5 @types/md5
nmp install --save blueimp-md5 @types/blueimp-md5
When I try to import it like this:
import { md5 } from '../../../node_modules/md5'
I get an error: Module <path> was resolved to <path>/md5.js, but '--allowJs' is not set.

This makes me think that the @types/md5 installed vise is simply not detected. In tsconfig.json, I have:
"typeRoots": [ "../node_modules/@types" ]
So, I think this should automatically detect node_modules/@types from the node_modules/@types folder, but apparently this is not the case. Exactly the same thing with the blueimp-md5 package. The md5 folder exists in the node_modules/@types folder, so it has everything in its place, but still does not work.
Visual Studio Code, TypeScript 2, Angular 2.
What am I doing wrong?
Edit: this is the contents of the @ types / md5 / index.d.ts file:
/// <reference types="node" /> declare function main(message: string | Buffer): string; export = main;
angular typescript visual-studio-code
Titan
source share