我正在我的 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 希望在dist
而不是dist/test
中找到index.html
.
关于如何解决这个问题的任何想法?
这是我所要参考的。
我将angular.json
输出路径更改为dist
,现在它可以工作:
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist/",