NFT Smart Contract Development Issues - Missing Files and Build Errors

I’m trying to create an NFT smart contract following a tutorial but running into several problems. The downloaded repository seems to be missing some important files. I can’t find the /contracts/rust/Cargo.toml file that should be there according to the instructions. Also missing is the package.json file which makes the build process fail right away.

I tried making a basic package.json myself:

{
    "name": "nft-contract-project"
}

This fixes the missing package file error but then I get a different problem:

yarn run v1.22.17
error Command "build:rs" not found.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Are these missing files and errors normal or is there something wrong with the tutorial setup? How can I get the build working properly?

sounds like you got an incomplete repo download tbh. try cloning again or check if theres a different branch with the missing files. also your package.json needs the actual build scripts defined, not just the name lol

The build:rs error indicates that your package.json is missing the scripts section. You must include the build commands that yarn is trying to locate. Additionally, verify if the tutorial specifies any dependencies like @near-sdk-js that should be present. Given the absence of the Cargo.toml file, it appears you’re working with a Rust-based NFT contract; thus, you need both the Rust toolchain and the correct build configuration. I recommend checking the tutorial’s GitHub issues or comments, as others may have encountered similar problems with missing files. It’s common for such tutorials to reference outdated repo structures that have since been reorganized.

Hmm, this is interesting - what tutorial are you following exactly? Sounds like the repo structure changed since the tutorial was written, but nobody updated the instructions.

Did you check for multiple folders? Maybe the rust contract is in a different directory? These NFT tutorials often put contracts in /near-contracts/ or something similar instead of /contracts/rust/.

Also - do you actually need both rust AND javascript builds? Some tutorials mix different approaches when you might only need one. What blockchain are you targeting?

Try checking the repo’s commit history to see if files were moved recently. That might show you where everything ended up. Also look for a scripts or build folder - they might have clues about the build process.