Why is Vercel CLI asking me to log in?

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 Token Expired

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.

WARNING: If there has been no activity using the token for 10 days, the token is deemed inactive and expires as a result.

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.

Issuing a New Token

If you are using Vercel CLI locally, use the following command:

vercel login
The vercel login command available with Vercel CLI.

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.

Couldn't find the guide you need?