ansi-styles known bugs
npm3 known bugs in ansi-styles, with affected versions, fixes and workarounds. Sourced from upstream issue trackers.
3
bugs
Known bugs
| Severity | Affected | Fixed in | Title | Status | Source |
|---|---|---|---|---|---|
| medium | any | \u2014 | Ambiguous error when keyword doesn't exist A strange error is thrown if the argument thrown to `keyword()` doesn't exist.
```
> chalk.keyword('blackfsdfsd')
16:00:00.000 index.js:16 Uncaught TypeError: Cannot read property '0' of undefined
at /src/chalk/chalk/node_modules/ansi-styles/index.js:16:39
at Function.<anonymous> (/src/chalk/chalk/index.js:76:63)
at eval (eval at buildStyle (/src/chalk/chalk/templates.js:68:22), <anonymous>:1:7)
at buildStyle (/src/chalk/chalk/templates.js:68:22)
at tmp.replace (/src/chalk/chalk/templates.js:111:16)
at String.replace (<anonymous>)
at module.exports (/src/chalk/chalk/templates.js:98:6)
at chalkTag (/src/chalk/chalk/index.js:214:9)
at Chalk.chalk.template (/src/chalk/chalk/index.js:36:20)
at Object.<anonymous> (/src/chalk/chalk/test-tmpl.js:9:14)
``` | fixed | github:36 |
| medium | any | \u2014 | blackBright doesn't exist ref chalk/chalk#257 | fixed | github:48 |
| medium | any | \u2014 | Malicious code in ansi-styles (npm) The package was compromised and malicious code added.
---
_-= Per source details. Do not edit below this line.=-_
## Source: ghsa-malware (f82dc187071d265457effc48cb50c7ac209143e5da1a502a633a1c35b88aac67)
Any computer that has this package installed or running should be considered fully compromised. All secrets and keys stored on that computer should be rotated immediately from a different computer. The package should be removed, but as full control of the computer may have been given to an outside entity, there is no guarantee that removing the package will remove all malicious software resulting from installing it.
| open | osv:MAL-2025-46967 |
API access
Get this data programmatically \u2014 free, no authentication.
curl https://depscope.dev/api/bugs/npm/ansi-styles