Repository navigation
Description
Describe the bug.
Every CLI command that loads an AsyncAPI document (validate, convert, generate, bundle, diff, ...) prints four warning lines from the config npm package before its real output:
WARNING: NODE_ENV value of 'production' did not match any deployment config file names.
WARNING: See https://github.com/node-config/node-config/wiki/Strict-Mode
WARNING: No configurations found in configuration directory:C:\Users\me\my-project\config
WARNING: To disable this warning set SUPPRESS_NO_CONFIG_WARNING in the environment.
They go to stderr, so piping still works, but every user sees them on every run. The last line even asks the user to set an environment variable to silence a tool they did not configure.
Cause (checked in the installed package and on master):
bin/run_bin(the binary installed from npm) setsprocess.env.NODE_ENV = 'production'.src/utils/logger.tsdoesimport config from 'config'and callsconfig.has('log.dir')at import time to build alogDirand create it withmkdirSync.- The
configpackage looks for aconfig/folder in the user's current working directory. The CLI does not ship one. Only the API server setsNODE_CONFIG_DIRbefore importing (src/apps/api/server.ts,src/apps/cli/commands/start/api.ts). logger.tsis imported bysrc/domains/models/SpecificationFile.ts, so every document command triggers it.- The winston logger in
logger.tsonly has aConsoletransport.logDiris created but never used by any transport, and nothing else insrc/reads it.
Introduced by #1825 (service-based refactor), first shipped in v3.3.0. The same lines appear in the logs attached to #2293, which is about the mkdirSync of this unused folder.
Expected behavior
Only the command's own output is printed.
Screenshots
$ asyncapi validate asyncapi.yaml
WARNING: NODE_ENV value of 'production' did not match any deployment config file names.
WARNING: See https://github.com/node-config/node-config/wiki/Strict-Mode
WARNING: No configurations found in configuration directory:C:\Users\me\my-project\config
WARNING: To disable this warning set SUPPRESS_NO_CONFIG_WARNING in the environment.
File asyncapi.yaml is valid but has (itself and/or referenced documents) governance issues.
...
How to Reproduce
npm install @asyncapi/[email protected]
npx asyncapi validate asyncapi.yaml
Any directory without a config/ folder reproduces it.
🖥️ Device Information [optional]
- Operating System (OS): Windows 11 (also seen on Linux in the [BUG] asyncapi cli race condition crash #2293 logs)
- @asyncapi/cli 6.2.1, Node 24.16.0
👀 Have you checked for similar open issues?
- I checked and didn't find similar issue
🏢 Have you read the Contributing Guidelines?
- I have read the Contributing Guidelines
Are you willing to work on this issue ?
Yes. Proposed fix: remove the unused logDir block (the config import, the path.join and the mkdirSync) from src/utils/logger.ts, since no transport writes to it. That removes the warnings and also the mkdirSync race from #2293 (which #2294 patches with recursive: true). If maintainers prefer to keep the directory, the smaller change is to only require('config') when NODE_CONFIG_DIR is set, which I have tested locally: the warnings disappear and the API server path still reads log.dir.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
github-actions commentedon Oct 15, 2026
Welcome to AsyncAPI. Thanks a lot for reporting your first issue. Please check out our contributors guide and the instructions about a basic recommended setup useful for opening a pull request.
Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out this issue.
fix: drop unused log dir setup that triggered node-config warnings