Install and authenticate the Vercel CLI
That CLI you installed for a workshop may still be the one your terminal finds. Before we open either app, we'll install the current Vercel CLI and connect it to the account we intend to use.
Outcome
Install the Vercel CLI and verify that it can access your Vercel account.
Hands-on exercise 1.1
Install
The CLI ships as an npm package. Install it globally so you can run it from anywhere:
npm install -g vercel@latestThe CLI requires Node.js. If node --version fails, install the LTS release from nodejs.org before continuing.
Authenticate
Log into your Vercel account:
vercel loginThe CLI starts an OAuth device flow and prints a verification URL. Open the URL on any browser-capable device, check that the location and request time match, then approve the login. The terminal confirms when authentication finishes:
> Success! Authentication complete.
Verify
Confirm the CLI is installed and authenticated:
vercel --version
vercel whoamiThe first command prints the CLI version. The second confirms which account is active.
Try It
Run both commands and check the output:
vercel --versionVercel CLI 60.1.3
Use the current Vercel CLI for this course. An older CLI may support FastAPI but lack support for the Services configuration and service bindings we'll use. Your version may be newer than the example above.
vercel whoamiyour-vercel-username
If vercel whoami returns your username, authentication worked. If the command reports that you're logged out, run vercel login again.
Commit
We haven't changed any project files, so there is nothing to commit yet.
Troubleshooting
vercel login waits for approval: Open the verification URL printed in the terminal and enter the device code if prompted. The browser can be on another device.
vercel: command not found after install: The global npm bin directory may be missing from your PATH. Run npm config get prefix to locate it, then add its bin directory to your PATH. You can also run the CLI through npx vercel.
Done-When
vercel --versionprints a version numbervercel whoamireturns your Vercel username
Solution
npm install -g vercel@latest
vercel login
vercel --version # check the installed version
vercel whoami # prints your Vercel usernameWas this helpful?