> For a complete index of all SignalWire documentation pages, fetch https://signalwire.com/docs/llms.txt

# validatePackages

> Validate that all required packages can be imported.

[ref-hasallpackages]: /docs/server-sdks/reference/typescript/agents/skill-base/has-all-packages

Attempt to `import()` every package listed in the skill class's
`REQUIRED_PACKAGES` static array. Returns the list of packages that failed to
import (empty array means everything is available). Python parity:
`validate_packages()` at `core/skill_base.py:112-124`.

Logs an error listing every missing package when the result is non-empty.

<Note>
  For a boolean check, use [`hasAllPackages()`][ref-hasallpackages]. Because
  the TS version uses dynamic `import()`, this method is async.
</Note>

## **Returns**

`Promise<string[]>` -- array of package names that failed to import. Empty when
all packages are available.

## **Example**

```typescript {9}
import { SkillBase } from '@signalwire/sdk';

export class ScraperSkill extends SkillBase {
  static SKILL_NAME = 'scraper';
  static SKILL_DESCRIPTION = 'Scrapes web pages.';
  static REQUIRED_PACKAGES = ['cheerio'];

  async setup(): Promise<boolean> {
    const missing = await this.validatePackages();
    if (missing.length > 0) {
      this.logger.error(`Install: npm install ${missing.join(' ')}`);
      return false;
    }
    return true;
  }
}
```