Repository: promptfoo/promptfoo
Issue: Cannot find module '@azure/identity'
Root cause: Validation Gap

**Describe the bug**
I just installed promptfoo using `npm i -g` but it appears to be missing a library

**To Reproduce**
Steps to reproduce the behavior, including example Promptfoo configurations if applicable:

1. Run `npm install -g promptfoo`
2. Run `promptfoo --version`
4. See error

`➜  tools promptfoo --version     
node:internal/modules/cjs/loader:1228
  throw err;
  ^

Error: Cannot find module '@azure/identity'
Require stack:
- /Users/alejeune/.npm/lib/node_modules/promptfoo/dist/src/providers/azure.js
- /Users/alejeune/.npm/lib/node_modules/promptfoo/dist/src/providers/adaline.gateway.js
- /Users/alejeune/.npm/lib/node_modules/promptfoo/dist/src/providers.js
- /Users/alejeune/.npm/lib/node_modules/promptfoo/dist/src/matchers.js
- /Users/alejeune/.npm/lib/node_modules/promptfoo/dist/src/assertions/index.js
- /Users/alejeune/.npm/lib/node_modules/promptfoo/dist/src/util/config/load.js
- /Users/alejeune/.npm/lib/node_modules/promptfoo/dist/src/commands/debug.js
- /Users/alejeune/.npm/lib/node_modules/promptfoo/dist/src/main.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1225:15)
    at Module._load (node:internal/modules/cjs/loader:1051:27)
    at Module.require (node:internal/modules/cjs/loader:1311:19)
    at require (node:internal/modules/helpers:179:18)
    at Object.<anonymous> (/Users/alejeune/.npm/lib/node_modules/promptfoo/dist/src/providers/azure.js:41:20)
    at Module._compile (node:internal/modules/cjs/loader:1469:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1548:10)
    at Module.load (node:internal/modules/cjs/loader:1288:32)
    at Module._load (node:internal/modules/cjs/loader:1104:12)
    at Module.require (node:internal/modules/cjs/loader:1311:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/Users/alejeune/.npm/lib/node_modules/promptfoo/dist/src/providers/azure.js',
    '/Users/alejeune/.npm/lib/node_modules/promptfoo/dist/src/providers/adaline.gateway.js',
    '/Users/alejeune/.npm/lib/node_modules/promptfoo/dist/src/providers.js',
    '/Users/alejeune/.npm/lib/node_modules/promptfoo/dist/src/matchers.js',
    '/Users/alejeune/.npm/lib/node_modules/promptfoo/dist/src/assertions/index.js',
    '/Users/alejeune/.npm/lib/node_modules/promptfoo/dist/src/util/config/load.js',
    '/Users/alejeune/.npm/lib/node_modules/promptfoo/dist/src/commands/debug.js',
    '/Users/alejeune/.npm/lib/node_modules/promptfoo/dist/src/main.js'
  ]
}

Node.js v20.18.0`

**Expected behavior**
I am not even using Azure with my configuration

**Screenshots**
If applicable, add screenshots to help explain your problem.

**System information:**

If possible, please output the results of `promptfoo debug` and paste the output here.

- Promptfoo version: 
Latest on npm 1/13


**Additional context**
Add any other context about the problem here.


@arlejeun see https://www.promptfoo.dev/docs/providers/azure/#using-client-credentials 

> You must also install a peer dependency from Azure:
>
> npm i @azure/identity

We limit peer dependencies for some of the less frequently used providers / auth methods etc. to not balloon the size of promptfoo. Given the importance of azure we will revisit this. I'll also improve the error message for this and other peer dependencies so that it's easier to debug.

Let us know if you run into any other issues!


Ok, thanks!

why is this a requirement if I am not even using azure?

It should not be! I'm re-opening the issue and will look into it. 

Thanks for the report @aandis and @arlejeun.  Should be fixed in https://github.com/promptfoo/promptfoo/pull/2708