【问题标题】:npm errors when I try to deploy website to github当我尝试将网站部署到 github 时出现 npm 错误
【发布时间】:2019-08-04 20:36:03
【问题描述】:

尝试使用 npm 在 github 上部署网站时出现终端错误

我不知道该尝试什么

PS C:\Users\user\modern_portfolio> npm run deploy
> modern_portfolio@1.0.0 deploy C:\Users\user\modern_portfolio
> gh-pages -d dist

The "file" argument must be of type string. Received type undefined
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! modern_portfolio@1.0.0 deploy: `gh-pages -d dist`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the modern_portfolio@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:
npm ERR!     C:\Users\user\AppData\Roaming\npm-cache\_logs\2019-08-04T04_12_42_515Z-debug.log

【问题讨论】:

  • 你查看日志内容了吗?
  • 是不是和stackoverflow.com/q/57314473/6309类似,本身就是重复的?
  • 日志对我来说没有多大意义 X,x
  • 这看起来和我的问题很相似!我可以像助手说的那样卸载 gh-pages 模块,但是如何安装特定版本的 gh-pages?
  • 哈!我将在上面回答我自己的问题...可以通过在 gh-pages 之后添加 @ 来安装旧版本。示例:npm i gh-pages@2.0.1

标签: html node.js github npm github-pages


【解决方案1】:

较新的 2.1 版存在一些问题。他们可能正在努力。恢复到 2.0.1。

  • 重新安装特定版本的 Github 页面:
npm uninstall gh-pages

npm i gh-pages@2.0.1

npm run deploy // as usual

【讨论】:

    猜你喜欢
    • 2021-03-19
    • 2022-06-22
    • 1970-01-01
    • 2021-11-03
    • 1970-01-01
    • 2023-03-22
    • 2020-03-27
    • 2014-03-08
    • 2016-03-09
    相关资源
    最近更新 更多