Closed ThisIsMissEm closed 1 year ago
I added in the polyfill from https://vanillajstoolkit.com/polyfills/stringreplaceall/ to .npm/_npx/80daaf8cfdca6619/node_modules/depngn/dist/cli.cjs
and it now works in node.js 14.x, but would still require a patch from your side.
Looks like you're intending to support Node.js >= 10.0.0:
"engines": {
"node": ">=10.0.0"
},
Maybe we can use a global regexp to not need a polyfill? like replace(/something/g, ...)
, that g
flag should work like a replaceAll
That's basically what the polyfill does anyway!
Expected Behavior
I was expecting a failing report (this is a node.js v14.20.0 project with some really bad/messy dependencies)
Actual Behavior
The following output:
Looks like maybe one of the dependencies may be doing something weird with the
engines
field or something?Steps to Reproduce
npx depngn 18
on a projectIf you want a repository you can try this in, then see: https://github.com/inrupt/pod-browser
Additional Information
I tried to add debug logging around the
depRange
line, and the only output it gave was{ depRange: '>=6.9.0' }
before failing. I tried doing atypeof
ondepRange
and it said "string", so I did atypeof depRange.replaceAll
and it saidundefined
.It looks like in node.js 14.x,
String.prototype.replaceAll
does not yet exist (it's a newer language feature):So if you want to support Node.js 14.x then you'll need to add a polyfill in.
What package manager are you seeing the problem with?
npm
Relevant log output
No response
Code of Conduct