Hardhat compilation failed because of Openzepplin library

My contract code:

// SPDX-License-Identifier: GNU AGPLv3
//https://choosealicense.com/licenses/

pragma solidity ^0.8.0;

import "./AmaFansCoreStorage.sol";

import "@openzeppelin/contracts-upgradeable@v4.4.2/security/ReentrancyGuardUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable@v4.4.2/utils/AddressUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable@v4.4.2/access/AccessControlEnumerableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable@v4.4.2/security/PausableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable@v4.4.2/proxy/utils/Initializable.sol";
// import "@openzeppelin/contracts-upgradeable/utils/CountersUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable@4.4.2/utils/CountersUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable@v4.4.2/metatx/ERC2771ContextUpgradeable.sol";

import "./ENS.sol";
import "./AmaFansLib.sol";
import "./AmaFansNFT.sol";
import "./AmaFansCoreEvents.sol";
import "./AmaSessions/IAmaSession.sol";
contract AmaFansCore is AmaFansCoreEvents,
                        Initializable, 
                        PausableUpgradeable,
                        ERC2771ContextUpgradeable,
                        AccessControlEnumerableUpgradeable,
                        ReentrancyGuardUpgradeable,
                        AmaFansCoreStorage{}

Everything is getting compiled in remix, but when I am doing `npx hardhat compile', I am getting the following error.

Error HH411: The library @openzeppelin/contracts@v4.4.2, imported from contracts/AmaFansCore.sol, is not installed. Try installing it using npm.

For more info go to https://hardhat.org/HH411 or run Hardhat with --show-stack-traces

I have installed the openzepplin package multiple times but with no success with compilation.

npm install @openzeppelin/contracts@4.4.2

please try with another version of openzepplin

You seem to be using both @openzeppelin/contracts and @openzeppelin/contracts-upgradeable. Install both. (Also make sure this is right, you should probably only be using the upgradeable version.)

Additionally, on Remix imports have to include the version number of the dependency, and on Hardhat they don't. So you need to remove the @v4.4.2 from the import statement.