npm run deploy error unable to publish on github pages - reactjs

I've had my personal website made with React published on Github pages for about a year now and I would always update it using the following commands:
git add .
git commit -m "update"
npm run deploy
git push -u origin main
The last time I was able to run these commands without fail was last week. Since then, the only changes I've done to the repo are changing the repo name on Github but now I'm unable to run the same commands without receiving a 403 error. In the end I decided to start a new repo but now I get the following error:
fatal: A branch named 'gh-pages' already exists.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! username.github.io#0.1.0 deploy: `gh-pages -d build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the username.github.io#0.1.0 deploy script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/computer/.npm/_logs/2021-08-17T22_31_00_085Z-debug.log
I've also tried manually removing gh-pages from node_modules/.cache but instead I get this error:
remote: Support for password authentication was removed on August 13, 2021. Please use a personal access token instead.
remote: Please see https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations/ for more information.
fatal: unable to access 'https://github.com/username/username.github.io.git/': The requested URL returned error: 403
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! username.github.io#0.1.0 deploy: `gh-pages -d build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the username.github.io#0.1.0 deploy script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/username/.npm/_logs/2021-08-17T22_41_14_919Z-debug.log
Is there anything else I can do besides give up?
*** note: I replaced my actual gh username for privacy

Related

Whenever I am trying to deploy my react app on gh-pages this error is coming?

Whenever I am trying to deploy my react app on gh-pages this error is coming
Cloning into 'C:\Users\Yasin\Desktop\HTML Projects\igvio-main\node_modules.cache\gh-pages\https!github.com!yasin-ai!igvio.git'...
error: unable to create file src/Media/4VGWsLNGhpXExFXdvAMxJ8Y7WxN-NoHaa0Jf01NNjWEZvR9IbI56c2-VrjIsmgZ0Cugensf-3qJDt3tkSRV-Y2LYGHrcPDJJmLPf9zpqFq94ocq16seQT0queKpLauUjwFKD2e7NZbs2jSDeJz0sx_1wr__psiwBSqkrW9kTiTPoe: Filename too long
fatal: unable to checkout working tree
warning: Clone succeeded, but checkout failed.
You can inspect what was checked out with 'git status'
and retry with 'git restore --source=HEAD :/'
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! instagram-tools#0.1.0 deploy: `gh-pages -d build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the instagram-tools#0.1.0 deploy script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Yasin\AppData\Roaming\npm-cache\_logs\2022-08-17T14_07_49_625Z-debug.log
PS C:\Users\Yasin\Desktop\HTML Projects\igvio-main> git config --system core.longpaths true
error: could not lock config file C:/Program Files/Git/etc/gitconfig: Permission denied
This was due to long file names and doing a simple config as below resolved it
git config --system core.longpaths true
or another solution is try using this
git reset

ASP.NET CORE with REACT.js npm run build code 1

When the project is trying to be deployed, I get the following Error:
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! s2cweb_react#0.1.0 build: react-scripts --expose-gc --max-old-space-size=8192 build
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the s2cweb_react#0.1.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/runner/.npm/_logs/2021-09-08T13_45_58_680Z-debug.log
/home/runner/work/MyProject/MyProjectApp/MyProjectApp.csproj(36,5): error MSB3073: The command "npm run build --prod" exited with code 1.
Error: Process completed with exit code 1.
I tried to change package.json as well as MyProjectApp.csproj but no luck. I Also tried without --prod but the same error persists. Please help me.

can not run command npm run deploy?

git#github.com: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! robofriends#0.1.0 deploy: `gh-pages -d build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the robofriends#0.1.0 deploy script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Hardik Sachan\AppData\Roaming\npm-cache\_logs\2020-12-29T16_31_31_944Z-debug.log
I had the same problem and I couldn't figure out what the problem was because I was able to push to my repo the entire time but could not get gh-pages to build my page. I fixed it by changing the following -
In my terminal, I typed:
git remote set-url origin https://github.com/username/projectname.git
what was in there before was my password protected SSH key. I went to my repo, clicked the 'code' button and copied the link for my https and inputted it where the italic text is above. I ran 'npm run deploy', it prompted me to login through my browser again but after that, it finally worked.

Unable to deploy React App to Github Pages

After adding the home, predeploy and deploy values to package.JSON and running npm run deploy, the build folder was created successfully but the build was unable to be published.
I got this error
cloning into 'node_modules\gh-pages\.cache\github.com.okafohenry!birthday-list-keeper-react-app-.git'...
fatal: unable to access https://github.com.okafohenry/birthday-list-keeper-react-app-.git/': Could not resolve host: github.com.okafohenry
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! birthdaylistkeeper#1.0.0 deploy: `gh-pages -d build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the birthdaylistkeeper#1.0.0 deploy script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
I have been on this for a while now, how do I fix it?
The url seems to be wrong.
It should be https://github.com/okafohenry/birthday-list-keeper-react-app-.git/

cannot start angular-phonecat, postinstall script failing [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 8 years ago.
Improve this question
I am currently setting up a vagrant box for starting the development of experimental node.js + angularjs app. Since I am just starting with angular, I want to give a first try to the angular-phonecat app, the one given as a tutorial by google.
I installed node in the guest machine, and the synced folder is where I cloned the angular-phonecat github repo (at the host machine but since it's synced, this shouldn't matter). In other words: all the files in the repo are present at my filesystem too.
I followed the steps mentioned at https://docs.angularjs.org/tutorial (step 0). Of course, I installed node at the guest machine.
The problem comes after the first time I run "npm install". The postinstall script is failing, so after this some dependencies are missing. I can start the server and access it from my host machine, where I see there are some 404 errors when trying to fetch jquery and other libraries from my host machine. Of course they are not there, and altough I could place them manually, this is not the way it should be.
This is the error I get
npm ERR! angular-phonecat#0.0.0 postinstall: `bower install`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the angular-phonecat#0.0.0 postinstall script.
npm ERR! This is most likely a problem with the angular-phonecat package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! bower install
npm ERR! You can get their info via:
npm ERR! npm owner ls angular-phonecat
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 3.2.0-23-generic
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install"
npm ERR! cwd /vagrant/angular-phonecat
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.14
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /vagrant/angular-phonecat/npm-debug.log
npm ERR! not ok code 0
If I do what the error suggests in order to track it down, I get
vagrant#precise64:/vagrant/angular-phonecat$ npm owner ls angular-phonecat
npm ERR! owner ls Couldn't get owner data angular-phonecat
npm ERR! 404 404 Not Found: angular-phonecat
npm ERR! 404
npm ERR! 404 'angular-phonecat' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, or http url, or git url.
npm ERR! System Linux 3.2.0-23-generic
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "owner" "ls" "angular-phonecat"
npm ERR! cwd /vagrant/angular-phonecat
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.14
npm ERR! code E404
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /vagrant/angular-phonecat/npm-debug.log
npm ERR! not ok code 0
So I am a bit stuck since I do not know how to interpret this second message. Any ideas? Anyone with a similar problem over there?
Already found it. I was tracking the wrong clue.
Git was not installed at the guest machine. I found this when I tried to run "bower install".
While git at the guest machine was not necessary for following the steps given at the angular-phonecat tutorial, it's used by bower to fetch the dependencies, and its absence was causing the postinstall script to fail.

Resources