Create Token Error: spl-token create-token

This seems like a good community.
I am new here. I used windows PC to create wallet (solana-keygen new --no-outfile), transfer some sol, check the balance, and now I am trying to create a new token (spl-token create-token). The error is:
error: could not read keypair file “C:/Users/.config/solana/id.json”. Run “solana-keygen new” to create a keypair file: The system cannot find the file specified. (os error 2)

Perhaps json file does not exists because of the “–no-outfile” option for the command that I had used.

I tried to transfer back to the wallet from where I had initially transferred the sol. That did not work either.
C:\Users>solana transfer <RECIPIENT_ADDRESS>
Error: Dynamic program error: No default signer found, run “solana-keygen new -o C:\Users.config\solana\id.json” to create a new one

So, should I run this command, as suggested:
“solana-keygen new -o C:\Users.config\solana\id.json”

Just worried that, if I create a new key, then I might loose/overwrite the old key. Also, the sol is already associated with the old key, not sure what to do here.
Many Thanks for your help.


Hi @snow and welcome to the forum! :wave:

Most of the Solana CLI will assume that you have a keypair stored in a file, and you are correct that you don’t have one because you chose to use --no-outfile.

To create that file using the wallet that you already created you can run solana-keygen recover ASK, and paste in your seed phrase.

The rest of the commands should work as you expect after that.

If you want to go on without storing your private key in a file, you can do that, but it’ll require more explanation, so let me know if you want to do that instead.

Thanks zicklag!
This worked. Appreciate your help.

1 Like