-1

desktop % ts-node ./metaplex/js/packages/cli/src/candy-machine-v2-cli.ts generate_art_configuration traits /usr/local/lib/node_modules/ts-node/src/index.ts:820 return new TSError(diagnosticText, diagnosticCodes); ^ TSError: ⨯ Unable to compile TypeScript: metaplex/js/packages/cli/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'; ~~~~~~~~~~~ metaplex/js/packages/cli/src/candy-machine-v2-cli.ts:5:25 - error TS2307: Cannot find module '@project-serum/anchor' or its corresponding type declarations.

5 import * as anchor from '@project-serum/anchor'; ~~~~~~~~~~~~~~~~~~~~~~~ metaplex/js/packages/cli/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'; ~~~~~~~~~~~~~~~~~ metaplex/js/packages/cli/src/candy-machine-v2-cli.ts:41:17 - error TS2307: Cannot find module 'loglevel' or its corresponding type declarations.

41 import log from 'loglevel'; ~~~~~~~~~~ metaplex/js/packages/cli/src/candy-machine-v2-cli.ts:45:25 - error TS2307: Cannot find module 'mime' or its corresponding type declarations.

45 import { getType } from 'mime'; ~~~~~~

at createTSError (/usr/local/lib/node_modules/ts-node/src/index.ts:820:12)
at reportTSError (/usr/local/lib/node_modules/ts-node/src/index.ts:824:19)
at getOutput (/usr/local/lib/node_modules/ts-node/src/index.ts:1014:36)
at Object.compile (/usr/local/lib/node_modules/ts-node/src/index.ts:1322:43)
at Module.m._compile (/usr/local/lib/node_modules/ts-node/src/index.ts:1454:30)
at Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
at Object.require.extensions.<computed> [as .ts] (/usr/local/lib/node_modules/ts-node/src/index.ts:1458:12)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12) {

diagnosticCodes: [ 2307, 2307, 2307, 2307, 2307 ]

max2lax
  • 5
  • 2

3 Answers3

2

It looks like you haven't yarn installed the JS folder.

But also a few months back the art generation was removed from the Metaplex repo. It was saved and extracted from an older repo by Halaprix and can be found here though if you wish to continue using it. https://github.com/halaprix/simple-NFT-generator

Alternatively you could also use Hashlips which is the most widely used generator currently. https://github.com/HashLips

Tony Boyle
  • 387
  • 1
  • 4
0

in your terminal write cd "the path of deprecated-clis" and then you need to install the dependencies with => yarn install

enter image description here

-2

I had already 'yarn install'-ed in the appropriate folder so other answer here didn't work for me. (Note: you can do directly in metaplex/js folder [cd metaplex/js; yarn install] or run from the main folder [yarn install --cwd ~/metaplex/js/]... i used the former ). I realized a bash-like tool in Windows (like cygwin) wasn't working with ts-node correctly:

cd metaplex/js
ts-node ./packages/cli/src/candy-machine-v2-cli.ts upload \
        -e devnet \
        -k /cygdrive/c/Users/myusername/.config/solana/id.json \
        -cp config.json \
        -c example \
        ./assets

It couldn't seem to find the modules that were installed and i got the same exact errors as the OP. It might be cause of Windows filepaths trying be accessed in a linux-like env. I tired full and relative paths as well like:

ts-node /cygdrive/c/nft_tests/metaplex/js/packages/packages/cli/src/candy-machine-v2-cli.ts ...

However this worked on Windows (I wasn't sure about if relative paths worked, so I just used the full paths to make life easier on me)

cd metaplex/js
ts-node "C:\nft_tests\metaplex\js\packages\cli\src\candy-machine-v2-cli.ts" upload     -e devnet     -k "C:\Users\myusername\.config\solana\id.json"     -cp config.json     -c example     ./assets
armyofda12mnkeys
  • 3,214
  • 2
  • 32
  • 39
  • The command does not even exist in current versions. Tony Boyles proposal to use HashLips seems to be a better idea now – Mark Sackerberg Jun 14 '22 at 20:30
  • I am using the latest MetaPlex from git I pulled yesterday and did all these steps myself to push onto devnet (these steps are on their official docs as well for now). https://github.com/metaplex-foundation/metaplex/blob/master/js/packages/cli/src/candy-machine-v2-cli.ts Note: I heard there is a cli tool maybe called Sugar which will replace these commands soon in Windows (might already be in Linux env?). – armyofda12mnkeys Jun 15 '22 at 21:07
  • Note: here are latest docs showing the same candy-machine-v2-cli.ts command being used: https://docs.metaplex.com/candy-machine-v2/creating-candy-machine Note: I used treat-toolbox to create the initial json/generated-image files (https://github.com/theskeletoncrew/treat-toolbox as HashLips wasn't as advanced I thought)... Then used metaplex to upload the files to the blockchain and create the mint website. – armyofda12mnkeys Jun 15 '22 at 22:01
  • That’s true but the question was about generate_art_configuration traits command, not the upload command – Mark Sackerberg Jun 15 '22 at 22:09
  • I got the same exact errors using a different metaplex command implying it can't find the required modules. Then I would suggest they use Windows Paths like how i did if they are on windows as well to resolve issue. – armyofda12mnkeys Jun 16 '22 at 00:54