Angular to GitHub Pages
Deploying an application
Run you project locally by
- Download the source code from your StackBlitz project by clicking the
Download Projecticon in the left menu, across from
Project, to download your project as a zip archive.
- Clone your Project from GitHub.
To run your project locally, you need the following installed on your computer:
npm install -g @angular/cli
cd to your project
To download and install npm packages, use the following npm CLI command:
Use the following CLI command to run your application locally:
To build your application for production, use the
build command. By default, this command uses the
production build configuration.
In our case, the name of the repository I created is angular-app, so the command will be:
ng build --output-path docs --base-href /angular-app/
The output path is given as docs since we know GitHub Pages look for files in two folders, root and docs. In root we have all other app data, so we can’t use it here. Instead, we have given a separate output folder named docs that we are going to use to host in GitHub Pages.
The base-href is an important argument since we use it to set the base path for resolving relative URLs to stylesheets, scripts, and many other resources.
How to solve “filename too long” error in git (Powershell and GitHub Application) for windows
error: lstat("node_modules/webdriver-js-extender/built/built/built/built/built/built/built/built/built/built/built/built/built/built/built/spec/command_tests/totally_real_apk.apk"): Filename too long
Open the Github Powershell or cmd.exe or Git Bash(you need to have git as an environment variable) and execute the following command :
git config --system core.longpaths true
In my experience, you may be facing the issue:
error: could not lock config file C:/Users/.gitconfig: Permission denied
You need to go the folder of Git Bash and check the Run this program as an administrator.
Git Bash directly (not from
poershell etc.) and type in
git config — system core.longpaths true again.
core.longpaths sould has been set to
Then you’re good to commit again:
git add .
in Vim interface:
- Type the subject of your commit on the first line. Remember to keep it short (not more than 50 characters). Leave a blank line after.
- Write a detailed description of what happened in the committed change. Use multiple paragraphs and bullet points to give a detailed breakdown. Don’t write everything out on one line, instead, wrap text at 72 characters.
Escand then type
:wqto save and exit.
Final and Example
Contact me: Hung, Chien-Hsiang (chienhsiang-hung.github.io)