Skip to main content
added 285 characters in body
Source Link

I am following the OpenZeppelin docs for deploying a smart contract. but when i run

npx hardhat compile

i get this error

ParserError: Source "node_modules/@openzeppelin/contracts/access/Ownable.sol" not found: File outside of allowed directories. --> contracts/Transactions.sol:5:1:

I have installed the openzepellin contracts library and i have checked manually to see if the file i am requiring in my contract exists. It does. I import it like this

import "../node_modules/@openzeppelin/contracts/access/Ownable.sol";

NB trying to import with this line

import "@openzeppelin/contracts/access/Ownable.sol";

results in my code editor throwing this warning (the compile command also fails)

Source "@openzeppelin/contracts/access/Ownable.sol" not found: File import callback not supported

I am following the OpenZeppelin docs for deploying a smart contract. but when i run

npx hardhat compile

i get this error

ParserError: Source "node_modules/@openzeppelin/contracts/access/Ownable.sol" not found: File outside of allowed directories. --> contracts/Transactions.sol:5:1:

I have installed the openzepellin contracts library and i have checked manually to see if the file i am requiring in my contract exists. It does. I import it like this

import "../node_modules/@openzeppelin/contracts/access/Ownable.sol";

I am following the OpenZeppelin docs for deploying a smart contract. but when i run

npx hardhat compile

i get this error

ParserError: Source "node_modules/@openzeppelin/contracts/access/Ownable.sol" not found: File outside of allowed directories. --> contracts/Transactions.sol:5:1:

I have installed the openzepellin contracts library and i have checked manually to see if the file i am requiring in my contract exists. It does. I import it like this

import "../node_modules/@openzeppelin/contracts/access/Ownable.sol";

NB trying to import with this line

import "@openzeppelin/contracts/access/Ownable.sol";

results in my code editor throwing this warning (the compile command also fails)

Source "@openzeppelin/contracts/access/Ownable.sol" not found: File import callback not supported

Source Link

NPX hardhat compile failing

I am following the OpenZeppelin docs for deploying a smart contract. but when i run

npx hardhat compile

i get this error

ParserError: Source "node_modules/@openzeppelin/contracts/access/Ownable.sol" not found: File outside of allowed directories. --> contracts/Transactions.sol:5:1:

I have installed the openzepellin contracts library and i have checked manually to see if the file i am requiring in my contract exists. It does. I import it like this

import "../node_modules/@openzeppelin/contracts/access/Ownable.sol";