0

enter image description hereI have created a metaplex candy machine v2. When i try to update the candy-machine i get an error refering to the candy machine source code line 845

Error location

C:\Users\Hardy V\Desktop\solana-nft-T1\metaplex-master\js\packages\cli\src\candy-machine-v2-cli.ts:845

this is the line of code

const candyMachine = new PublicKey(cacheContent.program.candyMachine);

TypeError: Cannot read properties of undefined (reading 'program')

Is there something wrong with the code or i am doing something wrong?

here is the command that i run ,

  • Please show the command you are running and the cache file. The cli can't find the candy machine address, so either you are missing the environment / RPC, or it does not find the cache file (-c parameter). How is your cache file called? – Mark Sackerberg Jul 04 '22 at 08:19
  • @MarkSackerberg here i have added a link to the command that i run, i didnt specify -c – Hardee Shareef Jul 05 '22 at 19:03

2 Answers2

0

Thanks for adding the image.

The error message tells us that the cli can not read the program value in the cache file and there are three possible reasons:

  1. you modified the cache file manually and destroyed the format (which no one should do)
  2. You are not running the command in the parent folder of the .cache folder where your cache file is located inside. Search that location and run the command in the parent folder
  3. If you used the -c parameter in the initial upload command then you have to use the same parameter value for every following command for that candy machine, too. Otherwise the cache file cannot be located.
Mark Sackerberg
  • 744
  • 2
  • 7
0

Try adding the -c <path_to_cache_file> parameter in te command.

This error is mostly caused when the command is unable to find your cache file or you have multiple cache files:)

Khushhal
  • 51
  • 8