无法运行命令 npm run deploy?

时间:2020-12-29 16:35:07

标签: reactjs create-react-app

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

1 个答案:

答案 0 :(得分:0)

我遇到了同样的问题,我无法弄清楚问题是什么,因为我能够一直推送到我的仓库,但无法获得 gh-pages 来构建我的页面。我通过更改以下内容来修复它 -

在我的终端中,我输入:

<块引用>

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

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