contracts-upgradeable/proxy/Initializable.sol not found

Hi I am trying to run the upgrade examples of the documentation and after installing the openzeppeling upgrade contract I am having this error:

ParserError: Source "@openzeppelin/contracts-upgradeable/proxy/Initializable.sol" not found
--> project:/contracts/MonitoringCenter.sol:5:1:

The file is on node_modules/@openzeppeling folder

:1234: Code to reproduce

import "@openzeppelin/contracts-upgradeable/proxy/Initializable.sol";

:computer: Environment

I am using ubuntu 20.04 and
npx truffle version
Truffle v5.4.10 (core: 5.4.10)
Solidity - 0.8.4 (solc-js)
Node v16.9.1
Web3.js v1.5.2

package.json
{
....
"devDependencies": {
"@openzeppelin/contracts": "^4.3.1",
"@openzeppelin/contracts-upgradeable": "^4.3.2",
"@openzeppelin/test-helpers": "^0.5.13",
"@openzeppelin/truffle-upgrades": "^1.9.1",
"chai": "^4.3.4",
"truffle": "^5.4.10"
}
}

Truffle

1 Like

Hi, welcome! :wave:

A little weird, nothing seems to be wrong, maybe you can remove the modules file and then `have a try.

the problem was a documentation error that I believe it was corrected. The lib is really at:
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";

2 Likes

hey, I am having the same problem as this. I just got a new error but it looks like its the same problem. here are my import statements, I am new to hardhat but not solidity so any help is appreciated!

import "../node_modules/@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "../node_modules/@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol";
import "../node_modules/@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol";
import "../node_modules/@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import "../node_modules/@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";

I am getting a parsing error:

ParserError: Source "node_modules/@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol" not found: File not found. Searched the following locations: "".
 --> contracts/hexicanMarketplace.sol:7:1: