Ic-avatar getting error "error: Found argument 'generate' which wasn't expected, or isn't valid in this context"

git clone the Ic-avatar tutorial and run,
dfx start
dfx deploy
I got the following error.
dfx -help does not have a subcommand generate.
What can I do to deal with this?

:ic-avatar $ dfx deploy
Deploying all canisters.
All canisters have already been created.
Building canisters...
Building frontend...
The post-build step failed for canister 'ryjl3-tyaaa-aaaaa-aaaba-cai' with an embedded error: The command '"npm" "run" "build"' failed with exit status 'exit code: 2'.
Stdout:

> ic_avatar@0.1.0 prebuild
> npm run generate:types


> ic_avatar@0.1.0 generate:types
> dfx generate avatar


Stderr:
error: Found argument 'generate' which wasn't expected, or isn't valid in this context

You’ll need to update dfx, v0.8.1 of the sdk added this command (it generates the bindings/type declarations for canisters, eg the .did and .did.js files).

Release notes for v0.8.1 are here: https://sdk.dfinity.org/docs/release-notes/0.8.1-rn.html

2 Likes

Thanks! I just did this about a month ago and you’ve already updated it. I didn’t know that.