1

I have logged in to Vercel using my Github account.

I run the command npm install -g vercel in Visual Studio Code (in the relevant project directory), it installs successfully but when I run 'vercel' or 'vercel login' it gives me the error:

*vercel : The term 'vercel' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:1

  • vercel login
  •   + CategoryInfo          : ObjectNotFound: (vercel:String) [], CommandNotFoundException
      + FullyQualifiedErrorId : CommandNotFoundException*
    

Any advice will be appreciated!! Thanks

Mea
  • 11
  • 1
  • 2

4 Answers4

4

Your PowerShell doesn't know the path where vercel located. To run vercel scripts you have to manually install or run the .ps1 script for the Powershell.

Run this script with PowerShell: C:\Users\YourUserName\AppData\Roaming\npm\vercel.ps1

Golamrabbi Azad
  • 369
  • 1
  • 9
2

if you are using ubuntu and you used yarn to install vercel just head to your terminal and run this command export PATH=$PATH:~/.yarn/bin

Bukenya KizzaRoland
  • 721
  • 1
  • 7
  • 13
  • This is not just for ubuntu. Had the same issue + fix for Mac. The same can happen for npm too btw (but than the path is different, of course) – Berci Jul 04 '23 at 09:23
1

The above solutions didn't work for windows at all.

Here's how I fixed it:

Open CMD in "Administrator" mode.

npm cache clear --force

npm install

npm config set cache C:\Users\myname\AppData\Roaming\npm-cache

npm config set prefix C:\Users\myname\AppData\Roaming\npm

Now do:

npm i -g vercel

vercel --version

It worked!

Nidhi
  • 41
  • 1
0

Just if you still have this problem running vercel --prod gave me an error that said "not recognized" npm vercel --prod worked thought