错误页面 – nuxt.js

huangapple go评论64阅读模式
英文:

errors on gh-pages - nuxt.js

问题

我在nuxt.js中有一个项目。我尝试通过运行npm install gh-pages --save-dev将其部署到gh-pages上。我在packed.json中添加了一些代码,一切正常,我在gh-pages上看到了我的项目。

https://aniaska4.github.io/business_card/

但突然我的项目消失了,我收到了一些错误:

错误页面 – nuxt.js

我在gh-pages分支中有一个.nojekyll文件,但错误仍然存在。

我不知道为什么。有什么提示可以帮助吗?

编辑:

对于所有遇到相同问题的人。我使用travis-ci再次部署了我的项目。这不仅适用于node.js,也适用于其他项目。现在一切正常。

英文:

I have a project in nuxt.js. I tried to deploy it on gh-pages doing npm install gh-pages --save-dev. I add some code to packed.json and was ok, a saw my project on gh-pages

https://aniaska4.github.io/business_card/

But suddenlly my project disapeared and I got an errors:

错误页面 – nuxt.js

I have .nojekyll file in gh-pages branch, but the errors are still here.

I dont know why. Any hints to help?

EDIT:

For everybody who have the same problem. I used travis-ci to deploy my project once again. This is not only for node.js but for other as well. Now it is ok.

答案1

得分: 1

  1. 你需要部署的只是 dist 文件夹中的内容,而不是整个文件夹本身。
  2. 你需要设置路由基础路径。

nuxt.config.js

export default {
  router: {
    base: '/<repository-name>/'
  }
}

查看 文档

英文:
  1. You need to deploy only the content of the dist folder not the folder itself
  2. You need to setup router base

nuxt.config.js

export default {
  router: {
    base: &#39;/&lt;repository-name&gt;/&#39;
  }
}

See docs

huangapple
  • 本文由 发表于 2020年1月3日 15:14:52
  • 转载请务必保留本文链接:https://go.coder-hub.com/59574569.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定