Matthew Wadham
Matthew Wadham

Reputation: 1

Candy Machine v2 - error: required option '-k, --keypair <path>' not specified

I have done numerous tutorials, and followed everything step by step but I keep getting stuck at this one step, running the following command:

npx ts-node ~/solana-nft/metaplex/js/packages/cli/src/candy-machine-v2-cli.ts upload \ 
-e devnet \
-k keypair.json \ 
-cp config.json \ 
./assets
I have done this in multiple variations but I keep getting the error:
error: required option '-k, --keypair ' not specified

Help?! Driving me nuts

Yarn version 1.22.18 Node version v14.17.0 solana-cli 1.9.13 ts-node version v10.7.0

I tried running

npx ts-node ~/solana-nft/metaplex/js/packages/cli/src/candy-machine-v2-cli.ts upload \ 
-e devnet \
-k keypair.json \ 
-cp config.json \ 
./assets

and I always get the failure "error: required option '-k, --keypair <path> not specified'

I have tried multiple variations according to several tutorials and every time I get the same error.

Upvotes: 0

Views: 710

Answers (3)

Liz
Liz

Reputation: 5

If the key pair path is correct and everything else checks out just change the ~ in code to . (I was experiencing this and this fixed my problem...I'm on a mac) so instead your code should be:

ts-node ./metaplex/js/packages/cli/src/candy-machine-v2-cli.ts upload \ 
-e devnet \
-k keypair.json \ (copy and past the location of the key pair path)
-cp config.json \ 
./assets

Upvotes: 0

Yilmaz
Yilmaz

Reputation: 49681

I think path to keypair is not correct. You create keypair:

solana-keygen new --outfile ~/.config/solana/devnet.json

then set this as default:

 solana config set --keypair ~/.config/solana/devnet.json

then you run upload command specifying ~/.config/solana/devnet.json as -k:

ts-node ~/solana-nft/metaplex/js/packages/cli/src/candy-machine-v2-cli.ts upload -e devnet -k ~/.config/solana/devnet.json -cp ./config.json ./assets

Upvotes: 0

Jon C
Jon C

Reputation: 8472

This might be just be the way that it was copy-pasted, but the command has one additional space at the end of a few lines, making the escaped newline \ fail. So instead of:

npx ts-node ~/solana-nft/metaplex/js/packages/cli/src/candy-machine-v2-cli.ts upload \ 
-e devnet \
-k keypair.json \ 
-cp config.json \ 
./assets

you need to do

npx ts-node ~/solana-nft/metaplex/js/packages/cli/src/candy-machine-v2-cli.ts upload \
-e devnet \
-k keypair.json \
-cp config.json \
./assets

Upvotes: 0

Related Questions