使用ngh

时间:2019-08-14 22:42:53

标签: node.js angular typescript github-pages angular-cli-ghpages

我正在我的angular 8项目中运行它:

    ole@mkt:~/test$ ngh
    index.html could not be copied to 404.html. This does not look like an angular-cli project?!
    (Hint: are you sure that you have setup the directory correctly?)
    Diagnostic info [Error: ENOENT: no such file or directory, stat '/home/ole/test/dist/index.html'] {
    errno: -2,
    code: 'ENOENT',
    syscall: 'stat',
    path: '/home/ole/test/dist/index.html'
    }
    ? Successfully published via angular-cli-ghpages! Have a nice day!
    ole@mkt:~/test$ ls dist/
    test

我得到index.html无法复制,看起来是因为Angular将生成文件生成到dist/PROJECT_NAME,在这种情况下,项目名称为test

我似乎ngh期望在index.html而不是dist中找到dist/test

关于如何解决此问题的任何想法?

This is the reference I was going by.

1 个答案:

答案 0 :(得分:1)

我将angular.json outputPath更改为dist,现在它可以工作了:

  "architect": {
    "build": {
      "builder": "@angular-devkit/build-angular:browser",
      "options": {
        "outputPath": "dist/",