I've installed md5
(also tried blueimp-md5
) package with corresponding typings like this:
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 installed @types/md5
typings are simply not discovered.
In tsconfig.json I have:
"typeRoots": [
"../node_modules/@types"
]
So I think it should be detecting typings from node_modules/@types
folder automatically, but it apparently does not. Exactly same thing with blueimp-md5
package. The md5
folder exists in node_modules/@types
folder, so it has everything in place but still doesn't work.
Visual Studio Code, TypeScript 2, Angular 2 project.
What am I doing wrong?
Edit: this is content of @types/md5/index.d.ts file:
/// <reference types="node" />
declare function main(message: string | Buffer): string;
export = main;