How to install Contracts/Mocks

Not able to install contracts/mocks

:computer: Environment



contracts/mocks does not install when I install @openzeppelin-contracts. I tried adding it with npm and get “Could not install from “@openzeppelin/contracts/mocks” as it does not contain a package.json file.”

:1234: Code to reproduce

npm install @openzeppelin/contracts


Welcome @jsfireman!

The mocks directory is used internally for testing. It’s not meant for people to use, and that’s why it’s not included in the npm package.

What were you trying to use from that directory?

1 Like

Hi @frangio
Thanks very much for helping! I am trying to run a smart contract test that uses @openzeppelin/contracts/mocks/ERC20Mock. Do you have any suggestions on how to get this to run?

1 Like

You should create a similar contract in your project, or (even better) use one of the existing ERC20 variants that come in the package.

1 Like

Thank you very much @frangio. I really appreciate. your help!


Hi @jsfireman,

Welcome to the community :wave:

If you get a chance it would be great if you could introduce yourself to the community

Feel free to ask all the questions that you need.