I am trying to flatten a solidity file but I keep getting cannot find part of path error as shown below

out-file : Could not find a part of the path 'D:\Blockchain\bullrun\src\contracts\ERC721.sol'.
At line:1 char:1
+ truffle-flattener ./node_modules\@openzeppelin/contracts/token/ERC721 ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OpenError: (:) [Out-File], DirectoryNotFoundException
    + FullyQualifiedErrorId : FileOpenFailure,Microsoft.PowerShell.Commands.OutFileCommand

enter image description here

The command Im trying to run is truffle-flattener ./node_modules@openzeppelin/contracts/token/ERC721/ERC721.sol > src/contracts/ERC721.sol. Can anyone tell me what is wrong in the command

  • Please do not screenshot errors, but use text copy-paste and code formatting. Mar 24, 2021 at 9:06
  • I have edited the question.
    – mzaidi
    Mar 24, 2021 at 9:10

1 Answer 1


Copy the folder from @openzeppelin from node_modules folder and paste it in the buildrun folder then, run the truffle-flattener

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.