Cause 1 of 6
The package ships no types and no @types package is installed.
Install the community types if they exist: npm i -D @types/<package>. If none exist, declare the module yourself in a d.ts file inside your project — declare module 'the-package'; — which silences the error at the cost of treating it as any, so add real signatures for the parts you use.
Cause 2 of 6
The path or the extension is wrong.
Relative specifiers resolve against the importing file, not the project root. Check the case too — enable forceConsistentCasingInFileNames so a mismatch that only breaks on Linux fails on your machine as well.
Cause 3 of 6
A path alias is configured for the compiler but not for the runtime.
paths in tsconfig.json teaches only tsc. The bundler or runner needs the same mapping: resolve.alias in Vite, moduleNameMapper in Jest, tsconfig-paths for ts-node. Configuring one and not the other produces this error in half your tools.
Cause 4 of 6
moduleResolution does not match how the package publishes its types.
Packages that use an exports map need "moduleResolution": "bundler" or "nodenext". The legacy "node" setting cannot see types behind an exports map at all, which is why a modern package appears untyped.
Cause 5 of 6
The editor is using a different TypeScript than the build.
In VS Code, run 'TypeScript: Select TypeScript Version' and choose 'Use Workspace Version', then 'TypeScript: Restart TS Server' after installing types. An error that only your editor shows is nearly always this.
Cause 6 of 6
You are importing a non-code asset.
import styles from './card.module.css' needs an ambient declaration. Frameworks ship one — reference vite/client or the framework's types in tsconfig, or write your own declare module '*.css'.