【问题标题】:can not run command npm run deploy?无法运行命令 npm run deploy?
【发布时间】:2021-05-08 11:53:48
【问题描述】:

git@github.com:权限被拒绝(公钥)。 致命:无法从远程存储库读取。

请确保您拥有正确的访问权限 并且存储库存在。

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

【问题讨论】:

  • 你的deploy 脚本是什么?
  • 部署:gh-pages -d build

标签: reactjs create-react-app


【解决方案1】:

我遇到了同样的问题,但我无法弄清楚问题出在哪里,因为我能够一直推送到我的 repo,但无法获取 gh-pages 来构建我的页面。我通过更改以下内容来修复它 -

在我的终端中,我输入了:

git remote set-url origin https://github.com/username/projectname.git

之前的内容是我受密码保护的 SSH 密钥。我去了我的仓库,单击“代码”按钮并复制了我的 https 链接并将其输入到斜体文本上方的位置。我运行了“npm run deploy”,它提示我再次通过浏览器登录,但在那之后,它终于成功了。

【讨论】:

  • 感谢您的回答。但我已经使用这些命令解决了这个问题:eval ssh-agent -s ssh-add ~/.ssh/id_ed25519
猜你喜欢
  • 2019-11-15
  • 2019-04-27
  • 2021-12-23
  • 2021-10-14
  • 2021-11-27
  • 2017-01-11
  • 2020-05-15
  • 2020-06-15
  • 2017-12-28
相关资源
最近更新 更多