can not run command npm run deploy? - reactjs

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.

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

Failed to get remote.origin.url task must either be run in a git repository with a configured origin remote or must be configuredwith the 'repo option

In my weather-app I am using npm run deploy command in terminal
But it gives this error:
Failed to get remote.origin.url (task must either be run in a git repository with a configured origin remote or must be configured with the "repo" option).
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! weather_app#0.1.0 deploy: `gh-pages -d build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the weather_app#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! /home/pankaj/.npm/_logs/2021-11-22T19_38_21_874Z-debug.log
Also I don't know which command should i write to get access to my git repository which is already pushed on my github account...
I had the same issue. I solved it by putting the following commands in the terminal: git init, get remote add origin (copy and paste the url from your github repository here, the parentheses are not needed), and then npm run deploy
I cloned the repo again, did npm run deploy and it worked for me!
I had the same issue. I believe it was because I forgot to run "git init" at the start of development. I just cloned my repository and it sorted itself out.
I had this issue too...:
Initially I had my project on external hard disk so I made a local copy of my project and tried the "npm run deploy" command again and it worked for me. (Just make sure your remote origin is correct).
I hope this helps.

npm run deploy error unable to publish on github pages

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

React app errors when pushing to GitHub pages

When pushing my React app to GitHub Pages, I continue to get various error messages. Some projects when viewed through GitHub just have a blank screen, others have 404 page not found errors, others bring up a page telling me that "this project was bootstrapped with create react app."
I have tried using several different tutorials to deploy the projects in different ways.
this one
this video
The one and only project I got to work I used "deploy": "gh pages -b master -d build". I have been installing gh pages using npm install gh-pages --save-dev on my projects.
This is an example of the error I get in my terminal:
sh: gh: command not found
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! count-up#0.1.0 deploy: `gh pages -b master -d build`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the count-up#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/connortwele/.npm/_logs/2020-08-08T15_59_50_754Z-debug.log
MacBook-Pro:count-up connortwele$

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/

Resources