2

I'm running some of my tests and receive error Cannot find module libsodium-wrappers from src/crypto/hash.ts

This is how I import this package import libsodium from 'libsodium-wrappers';

I've installed this package via yarn add @types/libsodium-wrappers

Seems like node cannot find such package, but it presents in node_modules directory. What am I doing wrong?

1 Answers1

2

Prefix @types usually means that this package contains only type definitions. There is no business logic behind.

It means that you also need to install libsodium-wrappers with yarn add libsodium-wrappers.

Please see Definitely Typed and related section in TS docs