发布更改:找不到错误命令 "publish-gh-pages"
Publish a change: error Command "publish-gh-pages" not found
我能够按照指南进行操作并发布了此页面:https://chengtie.github.io/docusaurus/docs/doc3/
现在,我想做一些小改动。在我的本地文件夹中更改代码后。我做到了:
GIT_USER=chengtie \
CURRENT_BRANCH=master \
USE_SSH=true \
yarn run publish-gh-pages
然后,我得到一个错误:
yarn run v1.16.0
error Command "publish-gh-pages" not found.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
有人知道怎么解决吗?
编辑 1:
Ties-MBP:my-website chengtie$ GIT_USER=chengtie CURRENT_BRANCH=master USE_SSH=true yarn run deploy
yarn run v1.16.0
$ docusaurus deploy
Deploy command invoked ...
fatal: not a git repository (or any of the parent directories): .git
Creating an optimized production build...
Success! Generated static files in build.
Cloning into 'docusaurus-gh-pages'...
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.
Error: Error: git clone failed
at build_1.build.then (/Users/chengtie/Downloads/my-website/node_modules/@docusaurus/core/lib/commands/deploy.js:84:23)
at processTicksAndRejections (internal/process/next_tick.js:81:5)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
这里是package.json
:
{
"name": "my-website",
"version": "0.0.0",
"private": true,
"scripts": {
"docusaurus": "docusaurus",
"start": "docusaurus start",
"build": "docusaurus build",
"swizzle": "docusaurus swizzle",
"deploy": "docusaurus deploy"
},
"dependencies": {
"@docusaurus/core": "^2.0.0-alpha.24",
"@docusaurus/preset-classic": "^2.0.0-alpha.24",
"classnames": "^2.2.6",
"react": "^16.8.4",
"react-dom": "^16.8.4"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}
这里是 Docusaurus 维护者!
yarn publish-gh-pages
是 V1 命令。在 V2 中它应该是 yarn deploy
。我看到您的链接站点是 V2 站点。请参阅部署文档 here.
尝试将命令更改为:
GIT_USER=chengtie \
CURRENT_BRANCH=master \
USE_SSH=true \
yarn run deploy
同时检查您的 package.json
并查看有哪些可用的 npm 脚本。
我能够按照指南进行操作并发布了此页面:https://chengtie.github.io/docusaurus/docs/doc3/
现在,我想做一些小改动。在我的本地文件夹中更改代码后。我做到了:
GIT_USER=chengtie \
CURRENT_BRANCH=master \
USE_SSH=true \
yarn run publish-gh-pages
然后,我得到一个错误:
yarn run v1.16.0
error Command "publish-gh-pages" not found.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
有人知道怎么解决吗?
编辑 1:
Ties-MBP:my-website chengtie$ GIT_USER=chengtie CURRENT_BRANCH=master USE_SSH=true yarn run deploy
yarn run v1.16.0
$ docusaurus deploy
Deploy command invoked ...
fatal: not a git repository (or any of the parent directories): .git
Creating an optimized production build...
Success! Generated static files in build.
Cloning into 'docusaurus-gh-pages'...
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.
Error: Error: git clone failed
at build_1.build.then (/Users/chengtie/Downloads/my-website/node_modules/@docusaurus/core/lib/commands/deploy.js:84:23)
at processTicksAndRejections (internal/process/next_tick.js:81:5)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
这里是package.json
:
{
"name": "my-website",
"version": "0.0.0",
"private": true,
"scripts": {
"docusaurus": "docusaurus",
"start": "docusaurus start",
"build": "docusaurus build",
"swizzle": "docusaurus swizzle",
"deploy": "docusaurus deploy"
},
"dependencies": {
"@docusaurus/core": "^2.0.0-alpha.24",
"@docusaurus/preset-classic": "^2.0.0-alpha.24",
"classnames": "^2.2.6",
"react": "^16.8.4",
"react-dom": "^16.8.4"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}
这里是 Docusaurus 维护者!
yarn publish-gh-pages
是 V1 命令。在 V2 中它应该是 yarn deploy
。我看到您的链接站点是 V2 站点。请参阅部署文档 here.
尝试将命令更改为:
GIT_USER=chengtie \
CURRENT_BRANCH=master \
USE_SSH=true \
yarn run deploy
同时检查您的 package.json
并查看有哪些可用的 npm 脚本。