o1-labs / zkapp-cli

CLI to create a zkApp (zero-knowledge app) for Mina Protocol
https://docs.minaprotocol.com/zkapps/how-to-write-a-zkapp
Apache License 2.0
114 stars 43 forks source link

Handle global cli version detection failure message #551

Closed satyambnsal closed 8 months ago

satyambnsal commented 8 months ago

550

Issue Description

Sometimes deploy script fails to detect the global cli version. it happens if user has installed Node via [Volta] (https://volta.sh/) or something similar. In that case npm list -g --depth 0 --json --silent doesn't include zkapp-cli.

If that happens, getInstalledCliVersion method returns undefined and code breaks.

Changes summary

To fix this, check the return value of getInstalledCliVersion and if is undefined, show a relevant message to user.