You might have spent some time away from using Vercel CLI only to return to it providing you with the following error:
Error! The specified token is not valid
This article covers off the likely reason for this and the action required to ensure Vercel CLI works again as it did previously.
Vercel CLI requires users to log in and authenticate before accessing user specific content or performing administrative tasks such as deleting projects or adding secrets. After logging in, a new token is generated which gives full permission to interact with the account.
Tokens are expired to increase the security of the Vercel platform platform by making sure there aren't any tokens issued that can be abused in the future.
If you are using Vercel CLI locally, use the following command:
vercel login
By using the vercel login
command, you will be logged in to your Vercel account locally, creating a token that will then be used for all other Vercel CLI commands.
If you are using Vercel CLI in a CI/CD environment, visit the tokens page on the Vercel Dashboard and create a new token that can replace the one previously invalidated.
If you'd like to keep the token active, make sure to use the CLI at least once every 10 days.