Search code examples
vue.jsdeploymentgithub-pages

when I try Publish my Vue App on Github Pages i getting some Errors in terminal when i run npm run deploy


the Terminal errors

fatal: invalid refspec 'main:'
npm ERR! code ELIFECYCLE
npm ERR! errno 128
npm ERR! [email protected] deploy: `sh deploy.sh`
npm ERR! Exit status 128
npm ERR!
npm ERR! Failed at the [email protected] deploy script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\mohamed mohamed\AppData\Roaming\npm-cache\_logs\2021-08-07T18_12_52_349Z-debug.log

the Deploy Script

    #!/usr/bin/env sh
set -e

npm run build
cd dist
git init
git add -A
git commit -m "New Deployment"
git push -f [email protected]:muojahead/find-a-coach.git main: github-pages
cd -

I added The SSH Key To the github settings and the branch which i upload My files on is "main"


Solution

  • You have forgotten to run npm install first in the deploy script