Skip to content

Doesn't work using yarn v4 and volta #52

@matheusrezende

Description

@matheusrezende

I use volta to manage my node versions and package manager, this means that in a project that I use yarn, npm or npx is unaccessible, and vice-versa.

When trying to run the script with yarn,

    "generate-client": "react-query-swagger /tanstack /input:https://localhost:7223/swagger/v1/swagger.json /output:src/api/axios-client.ts /template:Axios /serviceHost:. /use-recommended-configuration",

I get the following error:

image

I found the root cause inside the cli package being that the script is trying to run "nswag-portable" with npx thus, not being a valid command on my environment.

image

The fix is quite simple on my case, but unfortunately it is not propper for a production environment, so what I did was just fork and change to "yarn dlx nswag-portable"

image

But a more fitting fix, would be to detect the package manager, the version, and the correct way of running the nswag-portable, or to actually use nswag as a dependency of your project.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions