Angular-cli: Deploying to Github Pages using CLI command fails (1.0.0-beta.11-webpack.2)

Created on 27 Aug 2016  路  7Comments  路  Source: angular/angular-cli

Please provide us with the following information:

  1. OS? Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?)
    Windows 7
  2. Versions. Please run ng --version. If there's nothing outputted, please run
    in a Terminal: node --version and paste the result here:
    1.0.0-beta.11-webpack.2
  3. Repro steps. Was this an app that wasn't created using the CLI? What change did you
    do on your code? etc.
    Created using CLI- ng new projectname
  4. The log given by the failure. Normally this include a stack trace and some
    more information.
    PS > ng github-pages:deploy
    BuildingNo angular-cli-build.js found. Please see the transition guide: https://github.com/angular-cli/angular-cli/blob/master/TRANSITION.md#user-content-brocfile-transition.
  5. Mention any other details that might be useful.
    ng new projectname, cd projectname, npm install, ng build
    git remote add origin https://github.com/gmanojisaac/angularrc5.git
    ng github-pages:deploy
    shows the above error message.

Thanks! We'll be in touch soon.

Most helpful comment

Thanks msaradjuk,
I made sure Name in the package.json === name of git hub repository as mentioned by you.
And the application was deployed correctly in github and i was able to access the app using the deployed link now.

All 7 comments

as a workaround you can try the following:
ng build -prod
ng github-pages:deploy --skip-build

For deploying :
Go to github.com, login and create a repository-testrepo
ng new project
cd project
npm install
ng build --prod
git status
git remote -v
git remote add origin https://github.com/gmanojisaac/testrepo.git
ng github-pages:deploy --skip-build
Logged in with github username/password.
Shows : Deployed! Visit https://gmanojisaac.github.io/myconsent/
But it is not deployed when i accessed the link.- shows 404 site not found

The script changes the <base href""> of your index.html. Therefore the name in your package.json must be the same as the name of your github project.

Try to change "name": "myconsent" to "name": "testrepo" in your package.json and then run ng-build --prod

The github-pages deploy command should then show you the link:
https://gmanojisaac.github.io/testrepo/
which is the correct url to visit your github-page

Thanks msaradjuk,
I made sure Name in the package.json === name of git hub repository as mentioned by you.
And the application was deployed correctly in github and i was able to access the app using the deployed link now.

Fixed in https://github.com/angular/angular-cli/pull/1633/files#diff-a7ba0adbb6fe6918c418062849f4f412

@gmanojisaac I used the same commands as you did but one difference is that,

> ng github-pages:deploy

Now I am able to see my changes alive.
kksrini89.github.io/ng2website

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

_This action has been performed automatically by a bot._

Was this page helpful?
0 / 5 - 0 ratings

Related issues

JanStureNielsen picture JanStureNielsen  路  3Comments

ericel picture ericel  路  3Comments

rajjejosefsson picture rajjejosefsson  路  3Comments

purushottamjha picture purushottamjha  路  3Comments

gotschmarcel picture gotschmarcel  路  3Comments