Search code examples
angulargithubangular-cliangular-cli-ghpages

Angular 6 - Deploy Angular 6 to Github Pages error


I want to deploy my angular project in github.

I get this error:

enter image description here

I try to build in dist directly but nothing. any help will be approciated

****Edit:

I try run git remote set-url.. and ngh --no-silent

currently I get this:

enter image description here

I guess it's related to dist folder according this line:

'C:\\Users\\user\\Desktop\\Yaffa\\todo-list\\dist\\index.html'

but I ran ngh --dir=dist/todo-list
and in angular.json file have: "outputPath": "dist/todo-list",

so I could't understant what wrong


Solution

  • after a lot of search..

    what I did was:

    1. I updated git version ( it is help to "fatal: HttpRequestException encountered" error).
    2. I changed in angular.json the line to: "outputPath": "dist/" and copy all the files to dist folder directly.
    3. in cmd ran:

      ngh setup 
      ngh --no-silent --dir=dist/
      

    hope it is help