angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

ng github-pages:deploy is not working

Open asif633 opened this issue 9 years ago • 8 comments

OS?

Windows 10.

Versions.

angular-cli: 1.0.0-beta.22-1 node: 6.9.2 os: win32 x64 git: 1.9.4

Repro steps.

This app was generated using normal ng new angular2-rxjs. Then I run cd angular2-rxjs then ng serve. Worked properly in local browser. After running ng github-pages:deploy A github repository was created successfully also in the master branch the source code uploaded successfully. I got the below error. There was no gh-pages branch on github repository. My local project files were also deleted after the ng github-pages:deploy command. Auto created repositoy https://github.com/asif633/angular2-rxjs by ng github-pages:deploy command.

The log given by the failure.

In order to deploy this project via GitHub Pages, we must first create a repository for it.
It's safer to use a token than to use a password so you will need to create one
Go to the following page and click "Generate new token".
https://github.com/settings/tokens

Choose "public_repo" as scope and then click "Generate token".

? Please enter GitHub token you just created (used only once to create the repo): token-hidden
? and your GitHub user name: asif633
Command failed: git rm -r
usage: git rm [options] [--] <file>...

    -n, --dry-run         dry run
    -q, --quiet           do not list removed files
    --cached              only remove from the index
    -f, --force           override the up-to-date check
    -r                    allow recursive removal
    --ignore-unmatch      exit with a zero status even if nothing matched


Error: Command failed: git rm -r
usage: git rm [options] [--] <file>...

    -n, --dry-run         dry run
    -q, --quiet           do not list removed files
    --cached              only remove from the index
    -f, --force           override the up-to-date check
    -r                    allow recursive removal
    --ignore-unmatch      exit with a zero status even if nothing matched


    at ChildProcess.exithandler (child_process.js:206:12)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:191:7)
    at maybeClose (internal/child_process.js:877:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)

asif633 avatar Dec 19 '16 20:12 asif633

I'm responsible for this and am truly sorry. I wish it hadn't been included in 1.0.0-beta.22-1.

It has been fixed as of 1.0.0-beta.23 with the following.

Your files have not been deleted. You are just on the gh-pages branch, so within the app directory run:

git checkout master

Update to 1.0.0-beta.23 and the ng github-pages:deploy command will work fine.

rolyatsats avatar Dec 19 '16 23:12 rolyatsats

npm could not found [email protected]. So I downgraded after uninstalling angular-cli. I am now using [email protected]. Now ng github-pages:deploy is working fine. I will update to the latest version later. Thank you for your help.

asif633 avatar Dec 20 '16 09:12 asif633

hi i faced the same issue .. but beta 21 is not working for me

joyanta avatar Dec 20 '16 13:12 joyanta

I see that [email protected] is not on npm. Apparently there are other issues with that version and another release is coming soon.

Please double check your version by running:

ng --version

Also make sure your project is not on the gh-pages branch:

git checkout master

rolyatsats avatar Dec 20 '16 15:12 rolyatsats

Did all as y'all guys suggested. Its giving the following error message. No changes found. Deployment skipped.

an0nh4x0r avatar Jan 09 '17 19:01 an0nh4x0r

Getting "Failed to create GitHub repo. Error: 401 Unauthorized" when tries to deploys angular 2 app to my organization guthub page . Asking for a token and fails with 401

ng github-pages:deploy

? Please enter GitHub token you just created (used only once to create the repo): ? and your GitHub user name: Failed to create GitHub repo. Error: 401 Unauthorized

priyeshn avatar Feb 02 '17 05:02 priyeshn

It's not working for me too.

ghost avatar Feb 24 '17 21:02 ghost

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.