Npx oz deploy error: `Command failed: npm ls --depth=0`

I ran npx oz init after installing openzeppelin cli globally.
The project was originally a truffle project.
Then I ran npx oz deploy and got:

Command failed: npm ls --depth=0  
npm ERR! extraneous: readable-stream@3.6.0 /Users/gbemirojiboye/node_modules/hash-base/node_modules/readable-stream
npm ERR! extraneous: ethereumjs-util@5.2.0 /Users/gbemirojiboye/node_modules/ethereumjs-tx/node_modules/ethereumjs-util
npm ERR! extraneous: keccak@2.1.0 /Users/gbemirojiboye/node_modules/ethereumjs-util/node_modules/keccak
npm ERR! extraneous: aes-js@3.1.2 /Users/gbemirojiboye/node_modules/ethereumjs-wallet/node_modules/aes-js
npm ERR! extraneous: scryptsy@1.2.1 /Users/gbemirojiboye/node_modules/scrypt.js/node_modules/scryptsy
npm ERR! extraneous: get-stream@5.1.0 /Users/gbemirojiboye/node_modules/cacheable-request/node_modules/get-stream....

What to do, please?

:computer: Environment

MacOS Mojave
Truffle v5.1.30 (core: 5.1.30)
Solidity - 0.6.10 (solc-js)
Node v12.18.0
Web3.js v1.2.1


:1234: Code to reproduce

1 Like

Hi @gbenroscience,

Welcome to the community :wave:

Iā€™m sorry you are having this issue.

It sounds like you are trying to run commands locally when you installed globally.

If you install packages globally, such as @openzeppelin/cli then you can run commands as oz deploy.

If you install packages locally (in your project directory), then you need to use npx in front of the command such as npx oz deploy.

See Installing packages locally rather than globally (npx)

Hi @gbenroscience,

Were you able to resolve by either running the global command or install locally?

Thanks so much for asking. I had to leave it for now, as I am working on a deadline to release a product.
My next blockchain project will likely need to include OpenZeppelin, so I will look into it then.

1 Like