Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Too many positional arguments provided #392

Open
1 task done
abiriadev opened this issue Sep 26, 2023 · 0 comments
Open
1 task done

[BUG] Too many positional arguments provided #392

abiriadev opened this issue Sep 26, 2023 · 0 comments

Comments

@abiriadev
Copy link

abiriadev commented Sep 26, 2023

Is there an existing issue for this?

  • I have searched the existing issues

What version of workers-rs are you using?

N/A

What version of wrangler are you using?

wrangler 3.9.1

Describe the bug

In the README,

Getting Started

The project uses wrangler version 2.x for running and publishing your Worker.

Get the Rust worker project template manually, or run the following command:

npm init cloudflare project_name worker-rust
cd project_name

So I tried it, but the error like below occurred.

Steps To Reproduce

  1. Run the below command.
    $ docker run node:20.7 npm init -y cloudflare project_name worker-rust

Expected result

It should generate worker project for worker-rs.

Actual result

create-cloudflare [args]

Positionals:
  name                                                                  [string]

Options:
      --type                                                            [string]
      --framework                                                       [string]
      --deploy                                                         [boolean]
      --ts                                                             [boolean]
      --git                                                            [boolean]
      --open             opens your browser after your deployment, set --no-open
                          to disable                   [boolean] [default: true]
  -y, --accept-defaults                                                [boolean]
      --version          Show version number                           [boolean]
  -h, --help             Show help                                     [boolean]

Too many positional arguments provided
npm ERR! code 1
npm ERR! path /
npm ERR! command failed
npm ERR! command sh -c create-cloudflare project_name worker-rust

npm ERR! A complete log of this run can be found in: /root/.npm/_logs/2023-09-26T05_33_21_329Z-debug-0.log

Seems like create-cloudflare does not support generating templates or the README is outdated.

I tried something like npm init cloudflare@latest --type worker-rust but it keeps saying type is undefined.

├ What type of application do you want to create?type undefined

Note

In the template repository, it say I have to use one of the followings:

Setup

To create a my-project directory using this template, run:

$ npx wrangler generate my-project https://github.com/cloudflare/workers-sdk/templates/experimental/worker-rust
# or
$ yarn wrangler generate my-project https://github.com/cloudflare/workers-sdk/templates/experimental/worker-rust
# or
$ pnpm wrangler generate my-project https://github.com/cloudflare/workers-sdk/templates/experimental/worker-rust

So I tried it as well, and this time, it worked. However it shows warning like this:

 ⛅️ wrangler 3.9.1
------------------
▲ [WARNING] The `generate` command is no longer supported and will be removed in a future version.

I am new to cloudflare worker, so I have no idea which one is the correct one.

Thank you for working on this awesome project.

Regards.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant