"error: unknown account" when minting using web3.js

so i deployed my contract to the mumbai testnet via hardhat, now i want to interact with the smart Contract via web3.js, but when i call

contract.methods.createNFT(WALLET_ADDRESS, URI).send({ from: account.address })

i get the unknown account error.

This is my setup:

NFT.sol

pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol";
import "@openzeppelin/contracts/utils/Counters.sol";

contract MyNFT is ERC721URIStorage {
    using Counters for Counters.Counter;
    Counters.Counter private _tokenIds;

    constructor() ERC721("MyNFT", "MNFT") {}

    function createNFT(address recipient, string memory uri)
        public
        returns (uint256)
    {
        _tokenIds.increment();
        uint256 newItemId = _tokenIds.current();
        _mint(recipient, newItemId);
        _setTokenURI(newItemId, uri);

        return newItemId;
    }
}

test.js (node script that should trigger the createNFT function):

const Web3 = require('web3');

async function main() {
    const { abi } = require('./artifacts/contracts/NFT.sol/MyNFT.json');
    const rpcURL = 'https://rpc-mumbai.maticvigil.com'
    const web3 = new Web3(new Web3.providers.HttpProvider(rpcURL));

    const address = '0x...'
    const WALLET_ADDRESS = "0x..."
    const URI = "ipfs://QmUwUaiynu25kAGpuhqNgHehUhEzMGv5Y9SJRCK5aEM6F3"

    const account = web3.eth.accounts.privateKeyToAccount("0x...");

    const contract = new web3.eth.Contract(abi, address);
    
    try {
        r = await contract.methods.createNFT(WALLET_ADDRESS, URI).send({ from: account.address });
        console.log(r);
    } catch (err) {
        console.log(err);
    }
}

main().then((r) => {
    console.log(r);
}).catch(err => {
    console.log(err);
});

okay so i don’t know why the above problem was not working but i was able to get it working with ether.js

test.js (new with ether.js):

const ethers = require('ethers');

async function main() {
    const { abi } = require('./artifacts/contracts/NFT.sol/MyNFT.json');
    const rpcURL = 'https://rpc-mumbai.maticvigil.com';
    const provider = new ethers.providers.JsonRpcProvider({ url: rpcURL });
    const signer = provider.getSigner();

    const address = '0x...'
    const WALLET_ADDRESS = "0x..."
    const URI = "ipfs://QmUwUaiynu25kAGpuhqNgHehUhEzMGv5Y9SJRCK5aEM6F3"

    const privateKey = "...";

    const wallet = new ethers.Wallet(privateKey, provider);
    const contract = new ethers.Contract(address, abi, wallet);
    try {
        let tx = await contract.createNFT(WALLET_ADDRESS, URI);
        let r = await tx.wait();
        console.log(r);
    } catch (err) {
        console.log(err);
    }
    return {};
}

main().then((r) => {
    console.log(r);
}).catch(err => {
    console.log(err);
});