微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

使用 GitHub 使用 gh-pages 部署网站时出错

如何解决使用 GitHub 使用 gh-pages 部署网站时出错

我对此比较陌生,但我正在尝试部署我使用 gh-pages 和 Github 创建的 HTMLCSS 页面。到目前为止,我已经成功地创建了一个包含我需要的所有内容的主分支,但现在我正在努力将我的代码部署到 gh-pages 分支。每当我尝试运行 npm run deploy (我已经编写了一个脚本来部署到 gh-pages 存储库)时,问题就会出现,返回以下内容。我已经尝试过两次,但似乎真的不知道问题出在哪里。提前致谢。

> gh-pages -d dist

The "base" option must be an existing directory
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! websitetwo@1.0.0 deploy: `gh-pages -d dist`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the websitetwo@1.0.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:

0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node','/usr/local/bin/npm','run','deploy' ]
2 info using npm@6.14.9
3 info using node@v14.15.3
4 verbose run-script [ 'predeploy','deploy','postdeploy' ]
5 info lifecycle websitetwo@1.0.0~predeploy: websitetwo@1.0.0
6 info lifecycle websitetwo@1.0.0~deploy: websitetwo@1.0.0
7 verbose lifecycle websitetwo@1.0.0~deploy: unsafe-perm in lifecycle true
8 verbose lifecycle websitetwo@1.0.0~deploy: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/khoree/Desktop/HTMLCSS/websitetwo/node_modules/.bin:/Library/Frameworks/Python.framework/Versions/3.8/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/khoree/miniconda3/bin:/Users/khoree/miniconda3/condabin:/Library/Frameworks/Python.framework/Versions/3.8/bin
9 verbose lifecycle websitetwo@1.0.0~deploy: CWD: /Users/khoree/Desktop/HTMLCSS/websitetwo
10 silly lifecycle websitetwo@1.0.0~deploy: Args: [ '-c','gh-pages -d dist' ]
11 silly lifecycle websitetwo@1.0.0~deploy: Returned: code: 1  signal: null
12 info lifecycle websitetwo@1.0.0~deploy: Failed to exec deploy script
13 verbose stack Error: websitetwo@1.0.0 deploy: `gh-pages -d dist`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16)
13 verbose stack     at EventEmitter.emit (events.js:315:20)
13 verbose stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:315:20)
13 verbose stack     at maybeClose (internal/child_process.js:1048:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
14 verbose pkgid websitetwo@1.0.0
15 verbose cwd /Users/khoree/Desktop/HTMLCSS/websitetwo
16 verbose Darwin 20.2.0
17 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "deploy"
18 verbose node v14.15.3
19 verbose npm  v6.14.9
20 error code ELIFECYCLE
21 error errno 1
22 error websitetwo@1.0.0 deploy: `gh-pages -d dist`
22 error Exit status 1
23 error Failed at the websitetwo@1.0.0 deploy script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1,true ]

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。