Skip to content

TypeError: advisory.cwe.replace is not a function On yarn v1.22.19 and node v19.4.0

./node_modules/.bin/gitlab-yarn-audit
node:events:491
      throw er; // Unhandled 'error' event
      ^

TypeError: advisory.cwe.replace is not a function
    at parseAuditAdvisory (./node_modules/gitlab-yarn-audit/lib/parseAuditAdvisory.js:25:69)
    at Stream.write (./node_modules/event-stream/index.js:205:20)
    at stream.write (./node_modules/through/index.js:26:11)
    at Stream.ondata (node:internal/streams/legacy:20:31)
    at Stream.emit (node:events:513:28)
    at drain (./node_modules/through/index.js:36:16)
    at stream.queue.stream.push (./node_modules/through/index.js:45:5)
    at Stream.<anonymous> (./node_modules/event-stream/index.js:222:9)
    at stream.write (./node_modules/through/index.js:26:11)
    at Stream.ondata (node:internal/streams/legacy:20:31)
Emitted 'error' event on Stream instance at:
    at Stream.onerror (node:internal/streams/legacy:62:12)
    at Stream.emit (node:events:525:35)
    at Stream.write (./node_modules/event-stream/index.js:207:19)
    at stream.write (./node_modules/through/index.js:26:11)
    [... lines matching original stack trace ...]
    at stream.write (./node_modules/through/index.js:26:11)

Node.js v19.4.0

Tried to run this tool for the first time, found this error. Seems to be a dependency issue, or incompatible versions?

Any additional debugging I can do here?