Skip to content

Rewrite rules stopped working from npx on Windows #158

@kenlyon

Description

@kenlyon

I'm running on windows 10. I used to be able to supply command-line parameters for rewrite rules but today I ran into problems.

Windows is interpreting the ">" character in the rewrite rule as being the option to redirect output to a separate file, like you would here:

dir > files.txt

The most basic case that shows this is:

npx ws -r "/a -> /b"

The response I get is "Access is denied." which is Windows complaining about trying to write to /b.

There doesn't seem to be a way to escape the > character, so I've opted to use a lws.config.js config file instead, which solves the problem.

I'd suggest adding something about this to your wiki, as the Rewrite tutorial only mentions Windows needing double quotes instead of single quotes while in my case none of the inline examples work. It'd help others avoid the troubleshooting I had to go through.

Otherwise, I think your module is really useful. Thanks for making it!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions