Reputation: 31
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
Upvotes: 3
Views: 15983
Reputation: 1
I figured out the following and it worked on Windows:
cd
into your project directory pathnpm run build
(ensure that all dependencies are installed before that)vercel --version
It should work, and then you can deploy your project on Vercel by referring to https://blog.logrocket.com/9-ways-deploy-react-app-free/
Upvotes: 0
Reputation: 61
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!
Upvotes: 3
Reputation: 821
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
Upvotes: 4
Reputation: 137
Just if you still have this problem running vercel --prod
gave me an error that said "not recognized" npm vercel --prod
worked thought
Upvotes: 0
Reputation: 781
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
Upvotes: 4