Help with deprecated errors when installing OpenZeppelin on Windows 10 and node v14.4

Hi there, I’m trying to install OpenZeppelin but I’m running into some errors. I’ve tried searching around and I think I understand what is going on (some parts that are trying to be installed are no longer supported by OpenZeppelin?) but I’m unsure how to fix it.

:computer: Environment
Not sure how I can check what version of OpenZeppelin I’m trying to install?
Truffle v5.1.32 (core: 5.1.32)
Node v14.4.0
Windows 10 Home (v 1909, OS build 18363.900)

:memo:Details
This is the code I’m inputting into the Command Prompt:

npm install @openzeppelin/cli

These are the error codes that occur:

npm WARN deprecated truffle-config@1.1.16: WARNING: This package has been renamed to @truffle/config.
npm WARN deprecated typechain-target-truffle@1.0.2: For TypeChain 2.x use @typechain/truffle-v4 or v5
npm WARN deprecated typechain-target-web3-v1@1.0.4: For TypeChain 2.x use @typechain/web3-v1
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated mkdirp-promise@5.0.1: This package is broken and no longer maintained. ‘mkdirp’ itself supports promises now, please switch to that.
npm ERR! code ENOENT
npm ERR! syscall spawn git
npm ERR! path git
npm ERR! errno -4058
npm ERR! enoent Error while executing:
npm ERR! enoent undefined ls-remote -h -t ssh://git@github.com/web3-js/WebSocket-Node.git
npm ERR! enoent
npm ERR! enoent
npm ERR! enoent spawn git ENOENT
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\My PC\AppData\Roaming\npm-cache_logs\2020-07-02T09_05_00_160Z-debug.log

1 Like

Hi @Tranquil-Flow,

I’m sorry that you have this issue. The latest version of OpenZeppelin CLI is 2.8.2 which you will install using npm i @openzeppelin/cli.

As you are using Windows 10, I recommend considering using Windows Subsystem for Linux. I use WSL2 on Windows 10 and previously used WSL. The ecosystem is Linux focused, so I run into far fewer issues than when I developed natively on Windows.

See: Solidity Smart Contract development on Windows for more details.

Whilst I was able to install OpenZeppelin CLI using node 14 on WSL2, I would suggest using node 10 or node 12. There is currently an open issue for ganache-cli with node 14 https://github.com/trufflesuite/ganache-core/issues/568.

1 Like

Thanks, I was able to resolve this by following the info in the link you posted. Installed Ubuntu on WSL2, and used Node v12.18.2. This seems to have resolved this issue.

1 Like

Hi @Tranquil-Flow,

Great to hear. I am a fan of WSL2.