-1

我在我的 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.htmlindist而不是 in dist/test

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

这是我要经过的参考。

4

1 回答 1

3

I changed the angular.json outputPath to dist and now it works:

  "architect": {
    "build": {
      "builder": "@angular-devkit/build-angular:browser",
      "options": {
        "outputPath": "dist/",
于 2019-08-15T00:05:37.573 回答