Search code examples
solanametaplex

Error: Cannot find module code: 'MODULE_NOT_FOUND', (metaplex)


im heaving trouble uploading my NFT to the devnet in solana using metaplex cli

im following a tutorial on buildspace: https://buildspace.so/p/ship-solana-nft-collection/

(should be noted! im using WSL)

i followed as instructed and when i needed to upload my nfts throught metaplex i ran the command:

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

and then this eror pops up:

==========================================================================================

wallet public key: HAMgtaBZBZM8U1AJ5BGMDEcmoLqCzqL7mu9BU2kgrzCN (node:12137) ExperimentalWarning: buffer.Blob is an experimental feature. This feature could change at any time (Use node --trace-warnings ... to show where the warning was created) (node:12137) UnhandledPromiseRejectionWarning: Error: Non-base58 character at Object.decode (/home/deathsn1per/metaplex/js/node_modules/base-x/src/index.js:111:11) at new PublicKey (/home/deathsn1per/metaplex/js/node_modules/@solana/web3.js/src/publickey.ts:56:30) at getCandyMachineV2Config (/home/deathsn1per/metaplex/js/packages/cli/src/helpers/various.ts:164:9) at Command. (/home/deathsn1per/metaplex/js/packages/cli/src/candy-machine-v2-cli.ts:157:38) at processTicksAndRejections (internal/process/task_queues.js:95:5) (node:12137) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 3) (node:12137) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

=========================================================================================

i proceeded to inspect where the warning came from using:

node --trace-warnings ...

and it showed me this:

=======================================================================================

Error: Cannot find module '/home/deathsn1per/Projects/solanaXreact/nft-drop-starter-project/...' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15) at Function.Module._load (internal/modules/cjs/loader.js:746:27) at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:75:12) at internal/main/run_main_module.js:17:47 { code: 'MODULE_NOT_FOUND', requireStack: [] }

=========================================================================================

i thought maybe something wrong with the way installed metaplex, so i deleted every thing and re installed but nothing..

i installed metaplex files in home/deathsn1per/metaplex...

from what little i understand this is a problem with the modules, something went wrong with the installetion but i cant figure out what is it...

so im kinda lost as where to look even. or what to do to fix it, any help would be very nice!

i hope i provided with enough info (if needed more info pls dont kill just tell me what you need to know ;) )


Solution

  • The tutorial is way outdated. The tool that you are trying to use is deprecated and not supported anymore.

    You should be using sugar instead which is a cli that is way faster and more reliable than the old js cli.

    You can find a tutorial on the official docs here:

    https://docs.metaplex.com/developer-tools/sugar/tutorials/my-first-candy-machine