Angular 6 - Deploy Angular 6 to Github Pages error

152 Views Asked by At

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

2

There are 2 best solutions below

0
Yaffa On BEST ANSWER

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

0
Nikhil Lende On

Try this..

1) Firstly set origin by git remote set-url ..

2) Run with ngh --no-silent it will publish to git origin