'cannot use unlockAccount() in web3

i am trying to unlock a account using unlockAccount() from personal module but i am getting an error

const Web3 = require("web3");
const Personal = require("web3-eth-personal");
personal = new Personal(new Personal.providers.HttpProvider("https://mainnet.infura.io/v3/############"))
web3 = new Web3(new Web3.providers.HttpProvider("https://mainnet.infura.io/v3/#############"));
    try{
       acc = "0xd76d57a2F968587920D3ab2Db6BaC725a732263F"
       web3.eth.personal.unlockAccount(acc)
        }

    catch(err){
        console.log(err)
    }

i have even tried

const Web3 = require("web3");
const Personal = require("web3-eth-personal");
personal = new Personal(new Personal.providers.HttpProvider("https://mainnet.infura.io/v3/a9b1cf71e95a48ae8d9ca31790deae83"))
web3 = new Web3(new Web3.providers.HttpProvider("https://mainnet.infura.io/v3/a9b1cf71e95a48ae8d9ca31790deae83"));
    try{
       acc = "0xd76d57a2F968587920D3ab2Db6BaC725a732263F"
       personal.unlockAccount(acc)
        }

    catch(err){
        console.log(err)
    }

the error was

Error: Returned error: The method personal_unlockAccount does not exist/is not available
    at Object.ErrorResponse (/Users/vivek/programming/blockchain/sample/node_modules/web3-core-helpers/lib/errors.js:28:19)


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source