Open gambitboxdev opened 2 years ago
Cannot find commander, @project-serum/anchor, '@solana/web3.js and etc.
Try re-installing modules that are missing.
One of the example:
yarn add @project-serum/anchor
Thanks! I tried to re-install the modules, but it seems like it keeps getting an error with this one now even after trying to reinstalling @solana/spl-token and @metaplex-foundation/mpl-token-metadata
`TSError: ⨯ Unable to compile TypeScript: ~/deprecated-clis/src/helpers/various.ts:11:10 - error TS2305: Module '"@solana/spl-token"' has no exported member 'Token'.
11 import { Token, TOKEN_PROGRAM_ID } from '@solana/spl-token';
~/deprecated-clis/src/helpers/various.ts:20:3 - error TS2305: Module '"@metaplex-foundation/mpl-token-metadata"' has no exported member 'MetadataKey'.
20 MetadataKey,
~/deprecated-clis/src/helpers/various.ts:413:16 - error TS2693: 'Uses' only refers to a type, but is being used as a value here.
413 return new Uses({ useMethod: realUseMethod, total, remaining: total });
~/deprecated-clis/src/helpers/various.ts:441:37 - error TS2339: Property 'findByMint' does not exist on type 'typeof Metadata'.
441 const metadata = await Metadata.findByMint(
~/deprecated-clis/src/helpers/various.ts:450:36 - error TS2339: Property 'getEdition' does not exist on type 'typeof Metadata'.
450 const edition = await Metadata.getEdition(connection, collectionMintPubkey);
~~`
Hi, I see that you have { Token, TOKEN_PROGRAM_ID } from '@solana/spl-token';
It wrote it is @solana/spl-token has no exported member 'Token', it has been depreciated. Please check the spl-token documentation for their new update.
I think mostly are depreciated issue. Just update a new one and it will be fine.
When executing
ts-node ~/deprecated-clis/src/candy-machine-v2-cli.ts upload -e mainnet-beta -k ~/.config/solana/mainnet-beta.json -cp config.json -c example ./assets
I have been receiving this.
`C:\Users\admin\AppData\Roaming\npm\node_modules\ts-node\src\index.ts:750 return new TSError(diagnosticText, diagnosticCodes); ^ TSError: ⨯ Unable to compile TypeScript: ~/deprecated-clis/src/candy-machine-v2-cli.ts:4:47 - error TS2307: Cannot find module 'commander' or its corresponding type declarations.
4 import { InvalidArgumentError, program } from 'commander';
~/deprecated-clis/src/candy-machine-v2-cli.ts:14:45 - error TS2307: Cannot find module '@solana/web3.js' or its corresponding type declarations.
14 import { PublicKey, LAMPORTS_PER_SOL } from '@solana/web3.js';
~/deprecated-clis/src/candy-machine-v2-cli.ts:46:25 - error TS2307: Cannot find module 'mime' or its corresponding type declarations.
46 import { getType } from 'mime';
diagnosticText: "\x1B[96m~/deprecated-clis/src/candy-machine-v2-cli.ts\x1B[0m:\x1B[93m4\x1B[0m:\x1B[93m47\x1B[0m - \x1B[91merror\x1B[0m\x1B[90m TS2307: \x1B[0mCannot find module 'commander' or its corresponding type declarations.\r\n" + '\r\n' + "\x1B[7m4\x1B[0m import { InvalidArgumentError, program } from 'commander';\r\n" + '\x1B[7m \x1B[0m \x1B[91m
~~~\x1B[0m\r\n' + "\x1B[96m~/deprecated-clis/src/candy-machine-v2-cli.ts\x1B[0m:\x1B[93m5\x1B[0m:\x1B[93m25\x1B[0m - \x1B[91merror\x1B[0m\x1B[90m TS2307: \x1B[0mCannot find module '@project-serum/anchor' or its corresponding type declarations.\r\n" + '\r\n' + "\x1B[7m5\x1B[0m import * as anchor from '@project-serum/anchor';\r\n" + '\x1B[7m \x1B[0m \x1B[91m~~~~~~~\x1B[0m\r\n' + "\x1B[96m~/deprecated-clis/src/candy-machine-v2-cli.ts\x1B[0m:\x1B[93m14\x1B[0m:\x1B[93m45\x1B[0m - \x1B[91merror\x1B[0m\x1B[90m TS2307: \x1B[0mCannot find module '@solana/web3.js' or its corresponding type declarations.\r\n" + '\r\n' + "\x1B[7m14\x1B[0m import { PublicKey, LAMPORTS_PER_SOL } from '@solana/web3.js';\r\n" + '\x1B[7m \x1B[0m \x1B[91m~~~~~\x1B[0m\r\n' + "\x1B[96m~/deprecated-clis/src/candy-machine-v2-cli.ts\x1B[0m:\x1B[93m42\x1B[0m:\x1B[93m17\x1B[0m - \x1B[91merror\x1B[0m\x1B[90m TS2307: \x1B[0mCannot find module 'loglevel' or its corresponding type declarations.\r\n" + '\r\n' + "\x1B[7m42\x1B[0m import log from 'loglevel';\r\n" + '\x1B[7m \x1B[0m \x1B[91m~~\x1B[0m\r\n' + "\x1B[96m~/deprecated-clis/src/candy-machine-v2-cli.ts\x1B[0m:\x1B[93m46\x1B[0m:\x1B[93m25\x1B[0m - \x1B[91merror\x1B[0m\x1B[90m TS2307: \x1B[0mCannot find module 'mime' or its corresponding type declarations.\r\n" + '\r\n' + "\x1B[7m46\x1B[0m import { getType } from 'mime';\r\n" + '\x1B[7m \x1B[0m \x1B[91m~~\x1B[0m\r\n' + "\x1B[96m~/deprecated-clis/src/candy-machine-v2-cli.ts\x1B[0m:\x1B[93m51\x1B[0m:\x1B[93m22\x1B[0m - \x1B[91merror\x1B[0m\x1B[90m TS2307: \x1B[0mCannot find module '@project-serum/anchor/dist/cjs/utils/bytes' or its corresponding type declarations.\r\n" + '\r\n' + "\x1B[7m51\x1B[0m import { bs58 } from '@project-serum/anchor/dist/cjs/utils/bytes';\r\n" + '\x1B[7m \x1B[0m \x1B[91m~~~~~~~~~~~~\x1B[0m\r\n', diagnosticCodes: [ 2307, 2307, 2307, 2307, 2307, 2307 ] }`