Troubleshooting zkSync CLI
Troubleshooting zkSync CLI
Encountering issues with zkSync CLI? Here are some common problems and step-by-step recommendations for resolving them:
`unknown command` Error
If you encounter an unknown command
error, follow these steps:
a. Check the zkSync CLI Version
- Run
npx zksync-cli --version
to check your current version. - Compare it with the latest version available on npm.
- If your version is lower than the one on npm, follow the steps below. If your version is up-to-date, it's possible that the command was moved or renamed. Use
npx zksync-cli help
for a list of current commands or refer to the documentation.
b. Verify Local Installation
- Use
npm list zksync-cli
to check ifzksync-cli
is installed in the current directory or any parent directories from where you are running your terminal. - If it is indeed installed, make sure to uninstall it by running
npm uninstall zksync-cli
in its installation location. Remove all instances ofzksync-cli
until none are found bynpm list zksync-cli
.
c. Verify Global Installation
- Use
npm list -g zksync-cli
to check ifzksync-cli
is installed globally. - If it is installed globally, uninstall it using
npm uninstall -g zksync-cli
.
d. Clean npm Cache
- Run
npm cache clean --force
.
e. Use the Latest Version
- As a quick fix, or if the above steps don't resolve the issue, use
npx zksync-cli@latest [command]
, for example,npx zksync-cli@latest dev start
.
My Version is Outdated
If npx zksync-cli
is not running the latest version:
- Refer to the guide above to check and update your zkSync CLI version.
`command not found: npx` Error
If you receive a command not found: npx
error, it means Node.js is not installed or not correctly set up on your system:
- Install Node.js from https://nodejs.org/. This will also install
npm
andnpx
. - After installation, restart your terminal and try running
npx zksync-cli
again.
For all other issues, we encourage you to seek help or report them in our GitHub Discussions.