Best method to implement NFT minting script?

Minting still fails. I updated my script, but I get an error when calling the mint function. My revised code:

require('dotenv').config();
const ethersLib = require('ethers');
const nftCompiled = require('./NFTCompiled.json');

const netProvider = ethersLib.getDefaultProvider('sepolia', { api: process.env.API_KEY });
const userAccount = new ethersLib.Wallet(process.env.PRIVATE_KEY, netProvider);
const nftContract = new ethersLib.Contract(process.env.CONTRACT_ADDRESS, nftCompiled.abi, userAccount);

nftContract.mintNFT(process.env.USER_ADDRESS).then(console.log).catch(console.error);

Is my contract address correctly set up?

I experienced a similar issue when trying to mint NFTs, and what ultimately helped was a detailed review of the environment variables and network configurations. In my case, ensuring that the contract address exactly matched the one deployed on the specific network was critical. I verified that the network provider was pointing to the correct testnet and confirmed that all environment variables were correctly set. It might help to log these values before calling the mint function to isolate whether the issue is with the address or some other configuration.