deploy angular 2 app to github pages - failed

Related searches

I've been trying to deploy my angular 2 app to github pages so I can view the app on the hosted github link but no luck so far.

As soon as I finished my app, I ran these commands:

ng build --prod

git remote add origin "My REPO"
git commit -a
git push -u origin master

I then tried to running on terminal

ng github-pages:deploy

and got this error:

The specified command github-pages:deploy is invalid. For available options, see `ng help`.

After researching I ran across this page and followed the instructions:

I installed angular-cli-github-pages via npm on my project directory:

npm install --save-dev angular-cli-github-pages

it says I have to create the gh-pages so I ran this command below:

git checkout --orphan gh-pages

and then committed the files and pushed the changes and returned back to the origin master and ran the deploy command and it gave me the same error:

  The specified command github-pages:deploy is invalid. For available options, see `ng help`.

I've been going back and forth with different methods and it's not working. Can someone please point what I should do to properly deploy this to github pages?

I faced the same issue recently. After scouring the angular2 community for hours I was able to find that the angular-cli-github-pages module has been removed in the latest angular-cli release. To deploy your Angular 2 apps to gh-pages , you now need to install a new npm module which is quite similar to the older angular-cli-github-pages module but makes you do a little more work that the previous module.

The npm module is angular-cli-ghpages . You can find the documentation and steps on the npmjs page for the module.

Hope this helps you.

deploy angular 2 app to github pages - failed - angular - html, I've been trying to deploy my angular 2 app to github pages so I can view the app on the hosted github link but no luck so far. As soon as I finished my app, I ran� I was able to publish an app made with Angular Cli tool to Github Pages a few weeks ago, but now when I try to use the command ng github-pages: deploy I get the error: The specified command github-pages:deploy is invalid..

At First Install angular-cli ghpages

npm install -g angular-cli-ghpages

After installing next step is linking your repository. Run this command

ng build --prod --base-href "https://<user-name><repo>/" 

If You See Error Then ommit --prod and Run This Command

ng build --base-href "https://<user-name><repo>/" 

You can now see a dist folder in your angular 2 app directory.

Upload all files of dist folder on github repository.

Then From Settings Enable Github Pages. A link will be provided to you.

That's It.

Demo :

Successfully deploying to unsuccessful Github Pages � Issue #3794 , with using angular-cli :deploy my gh-pages branch is not css and js path ( appending project-name in front of path) application works but with� Create your angular app with Angular CLI; Create a git repository; Push your changes from local repository; Deploy; Get through the hurdles (optional) Safety tips; Create your angular app with Angular CLI ng new my-app --routing=true --style=scss. Now move to the project folder. cd my-app. Install all the dependencies. npm install. Check your

I find that the easiest way to deploy to Github Pages is to either use master branch or docs in master branch as the source option in Settings. I go for the docs in master branch option and treat the docs folder as the build directory. It has worked pretty well. I just push to master, Github detects the docs folder and then creates the app/page with its contents.

Deploying Github Page � Issue #720 � angular/angular-cli � GitHub, When you run the command ng github-pages:deploy and the project It creates a github project named ng2-test-project; failed due to some token issue, Error: 401 Unauthorized" when tries to deploys angular 2 app to my� Learn more about deploying your Angular app on GitHub Pages. In this article, I am going to share with you my learnings while I was trying to publish my Angular app on GitHub Pages.

To deploy your Angular application to Github follow the next steps:

  1. Install Angular-cli-ghpages npm package:

    npm install -g angular-cli-ghpages

  2. Execute "ng build" to generate the dist folder:

    ng build --base-href ""

  3. Execute "ngh" (Angular-cli-ghpages) to publish site to your Github repository.

    sudo ngh --repo --no-silent

The console will show something like this:

Cloning<username>/repo into ../../../../../../usr/local/lib/node_modules/angular-cli-ghpages/node_modules/gh-pages/.cache


Fetching origin

Checking out origin/gh-pages

Removing files

Copying files

Adding all



Successfully published!

This will push your local dist folder to a branch called "gh-pages" into your Github repository. Then in your Github repository, click on Settings, go to GitHub Pages section and select "gh-pages branch" in the drop-down selector.

Note: Next time you make changes and want to deploy your app, execute the step 2 and 3. Take in care that it takes some time (minutes) to refresh the changes in Github.

ng github-pages:deploy is not working � Issue #3638 � angular , This app was generated using normal ng new angular2-rxjs. After running ng github-pages:deploy A github repository was created successfully also in the master branch the source Getting "Failed to create GitHub repo. Let’s see how to deploy the Angular application to GitHub Pages. So, here, you can read everything about Github Pages and how it works. It is the simplest hosting you can get, or deploying Angular applications. Basically, your application is hosted directly from your GitHub Repository.

Try using angular-cli-ghpages

I assume you were able to push the code successfully to the repo. Make sure the following things are in place:

  1. Angular Cli Version should be 8+.
  2. Repo should be public and not private - navigate to settings and change the repo to public.
  3. Try the following command: ng deploy --repo= -- base-href=

Check the network tab to see if the bundles are being loaded successfully, else clear the cache once and try : ctrl + shift + R.

Unable to deploy organization to github pages with --user-page flag , Mac OSX (Sierra) Versions. angular-cli: 1.0.0-beta.19-3 node: 6.6.0 os: darwin x64 In this order: Created project with ng new newProject Created repo on for details. at ChildProcess.exithandler (child_process.js:206:12) at� In this post, I am going to show you how to deploy angular apps to GitHub pages. You can think of GitHub pages as a free hosting platform that you can use to host client-based apps. You can host things like demos, portfolios, documentations etc. You can use it to host any client-side app as long as you comply to GitHub terms and conditions.

Hi All, I tried to build a personal website following a template and the website worked perfectly locally. However, after I deployed it to GitHub Pages, I can only see a blank page. I checked the Javascript console an…

But hosting an Angular 2+ app—with its TypeScript code, node_modules dependencies, and “production mode”—is far more complex, and not as simple as a quick upload. In this article we’ll look at one way you can get an Angular web app out to the world quickly using the Angular CLI and GitHub Pages.

Deploy to GitHub pageslink. Another simple way to deploy your Angular app is to use GitHub Pages. You need to create a GitHub account if you don't have one, and then create a repository for your project. Make a note of the user name and project name in GitHub. Build your project using Github project name, with the Angular CLI command ng build

  • Note: There is a bug which keeps asking about your email even thought you have set it at Use the following command to get it working: ngh --no-silent
  • @AnandRockzz, honestly I didn't face this issue. But I kept facing another issue where the cache file would store the repo I hosted on gh-pages and wouldnt let me host a second project. So for that I had to locate the cache file and remove it altogether. I feel that issue arose because I installed the module globally, so if you install it within your repo, you shouldnt face that issue. Thanks for your finding and its resolution though.
  • In my case, it is deployed successfully and loading https linked scripts but not local js bundle scripts and css source files, thus results in blank page. In GitHub issues, a person commented to add the source file links according to relative location. I did that too, still no luck. What I'm thinking is, my angular GitHub page is not running under a server..! So it's unable to load local scripts
  • Your are not using angular-cli-ghpages at all. You only have installed it.
  • I think without installing angular-cli-ghpages you can not run build command.
  • The command 'ng build' is from Angular. The command 'ngh' is from angular-cli-ghpages.