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

error executing wasm-pack new (cannot parse 'latest' as a semver) #907

Closed
laurogama opened this issue Aug 26, 2020 · 12 comments · May be fixed by #964
Closed

error executing wasm-pack new (cannot parse 'latest' as a semver) #907

laurogama opened this issue Aug 26, 2020 · 12 comments · May be fixed by #964
Labels
bug Something isn't working

Comments

@laurogama
Copy link

🐛 Bug description

When running wasm-pack new rust-example an error in cargo-generate occurs
the following log is printed

error: the `--vers` provided, `latest`, is not a valid semver version: cannot parse 'latest' as a semver

Error: Installing cargo-generate with cargo
Caused by: failed to execute `cargo install`: exited with exit code: 101
  full command: "cargo" "install" "--force" "cargo-generate" "--version" "latest" "--root" "/home/lgama/.cache/.wasm-pack/.cargo-generate-cargo-install-latest"

🤔 Expected Behavior

a new wasm-pack project should be created

👟 Steps to reproduce

Have a previous rust toolchain installed
install wasm-pack with curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
execute wasm-pack new rust-example

🌍 Your environment

wasm-pack version: 0.9.1
rustc version: rustc 1.45.0 (5c1f21c3b 2020-07-13)

@laurogama laurogama changed the title error executing wasm-pack new error executing wasm-pack new (cannot parse 'latest' as a semver) Aug 26, 2020
@laurogama
Copy link
Author

similar to #828

@richiksc
Copy link

I get the same issue when running wasm-pack new v0.9.1 with the patched lockfile from #960 on an Apple Silicon based Mac.

@fasidOnGit
Copy link

Facing the same issue with wasm-pack new

@SamNelson
Copy link

A work around for this is to just cargo install cargo-generate.
If wasm-pack finds cargo-generate it will skip the install.

@fasidOnGit
Copy link

@SamNelson Thanks for the quick response, I was actually doing that. Just in case if it helps anyone I also had to do sfackler/rust-openssl#1021 (comment) , before cargo install cargo-generate to make it successful.

@AnubhabB
Copy link

Facing the same issue on Mac wasm-pack v0.9.1. cargo install cargo-generate didn't help.

@fasidOnGit
Copy link

We are recently bitten by this error too often. A recent PR that updated the docs had the same issue,
#967 (comment)

@WanderHuang
Copy link

Same problem met in OSX. I use this method instead:

  1. cargo install cargo-generate
  2. cargo generate --git https://github.com/ashleygwilliams/wasm-pack-template.git

It just works to generate a crate by template

@AlexMikhalev
Copy link

@WanderHuang thank you for your comment - it helped me to progress.
The issue isn't mac specific - the same behaviour on Linux and cargo install cargo-generate didn't help.

@raffaeler
Copy link

Same here on Windows.
An additional problem is that if you run the build command manually (cargo install --force cargo-generate --root folder_name) inside a developer command prompt (the one already having the environment variables set), the build fails with hundreds of error LNK2019: unresolved external errors. It works if you start from a command prompt (no developer).

Once the cargo-generate.exe is created, you have to manually copy it in the .cargo/bin folder.
Finally the wasm-pack new projectname works, but hey!

@insinfo
Copy link

insinfo commented Jun 17, 2021

Facing the same issue with wasm-pack new example
wasm-pack 0.9.1

Windows 10 64bits

@drager
Copy link
Member

drager commented Jul 2, 2021

Should be fixed in the v0.10.0

@drager drager closed this as completed Jul 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet