upgradejs / depngn

A CLI tool to find out if your dependencies support a given version of node.
MIT License
103 stars 4 forks source link

[Bug]: depngn fails if a dependency has `*` as the node version #18

Closed arielj closed 1 year ago

arielj commented 1 year ago

Expected Behavior

depngn should handle * for versions without errors

Actual Behavior

If a dependency has * as the version restriction for node, depngn fails with the following error:

Error: Error: Invalid argument not valid semver ('*' received)
    at /../depngn/dist/cli.cjs:7519:27
    at step (/../depngn/dist/cli.cjs:65:23)
    at Object.throw (/../depngn/dist/cli.cjs:46:53)
    at rejected (/../depngn/dist/cli.cjs:37:65)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)

Steps to Reproduce

  1. Use a package that has a * as the version for node
  2. Run depngn to run the report

Additional Information

Setting * for the node version is valid, check https://github.com/moment/moment/blob/develop/package.json#L36 for example.

It is also listed as an option in the npm docs https://docs.npmjs.com/about-semantic-versioning#using-semantic-versioning-to-specify-update-types-your-package-can-accept (seems like x is a valid value)

It's also valid in the semver calculator https://semver.npmjs.com

What package manager are you seeing the problem with?

No response

Relevant log output

No response

Code of Conduct