gh-pages -d在"npm run deploy"上构建失败 [英] gh-pages -d build fails on 'npm run deploy'
本文介绍了gh-pages -d在"npm run deploy"上构建失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试将我的React应用程序部署到GitHub页面,但是遇到以下错误:
I am trying to deploy my react app to the GitHub pages but I have encountered the following error:
The build folder is ready to be deployed.
To publish it at https://jatinkumarg.github.io/personal-portfolio, run:
npm run deploy
> personal-portfolio@0.1.0 deploy C:\react-projects\personal-portfolio
> gh-pages -d build
Cloning into 'node_modules\gh-pages\.cache\git@github.com!jatinkumarg!personal-portfolio.git'...
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! personal-portfolio@0.1.0 deploy: `gh-pages -d build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the personal-portfolio@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\jatin\AppData\Roaming\npm-cache\_logs\2019-07-23T04_40_54_788Z-debug.log
- 我已经设置并测试了我的ssh密钥,它工作正常.
- 只有一个远程URL,即origin(SSH)
这是我的package.json
This is my package.json
{
"name": "personal-portfolio",
"version": "0.1.0",
"homepage": "https://jatinkumarg.github.io/personal-portfolio",
"dependencies": {
"jquery": "^3.4.1",
"json-loader": "^0.5.7",
"react": "^15.5.4",
"react-dom": "^15.5.4"
},
"devDependencies": {
"gh-pages": "^1.0.0",
"react-scripts": "1.0.1"
},
"scripts": {
"predeploy": "npm run build",
"deploy": "gh-pages -d build",
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
}
}
在这一点上,我不知道出了什么问题.有人可以帮我解决这个问题吗?
At this point, I have no idea what's wrong. Can anyone please help me with this issue?
推荐答案
您需要 PRO
计划才能在私有存储库上使用GitHub页面.
You need the PRO
plan to use GitHub pages on a private repository.
您可以尝试在〜/.ssh/config中添加SSH身份
You can try adding a SSH identity in ~/.ssh/config
Host github.com
HostName github.com
User git
IdentityFile /Users/myusername/.ssh/my_github_ssh_private_key_registered_on_github
这篇关于gh-pages -d在"npm run deploy"上构建失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文