Could not find a declaration file for module ‘module-name’. ‘/path/to/module-name.js’ implicitly has an ‘any’ type

Here are two other solutions

When a module is not yours – try to install types from @types:

npm install -D @types/module-name

If the above install errors – try changing import statements to require:

// import * as yourModuleName from 'module-name';
const yourModuleName = require('module-name');

Leave a Comment