我使用 CLI 创建了默认的 Angular 应用程序,如下所示:
ng new ng-test-deploy
Run Code Online (Sandbox Code Playgroud)
测试将虚拟应用程序部署到 Github 页面。我完成了此处定义的程序,总而言之,它执行以下操作:
ng build --prod --base-href "https://USERNAME.github.io/REPOSITORY_NAME/"
angular-cli-ghpages
Run Code Online (Sandbox Code Playgroud)
这样做之后,我访问了该页面并收到一个空白页面。在控制台中,加载文件时出现多个错误:
如果我检查 say 的 url,main.bundle.js我可以看到路径指向https://katana24.github.io/main.3188de4880a80d258168.bundle.js
而我可以通过将 repo 名称添加到 url 中来加载它,如下所示:
https://katana24.github.io/ng-test-edeploy/main.3188de4880a80d258168.bundle.js
我搞砸了一步吗?
先前问题的答案建议删除该base-href="..."值,但这对我来说没有意义。那么我如何让它看起来在正确的地方呢?
我已经在 GitHub 页面上成功发布了我的应用程序,但我的网站没有显示任何内容。
这是我的 GitHub 存储库链接:https : //github.com/chirag299051/Ice-and-Fire
我在控制台中遇到的错误:
inline.318b50c57b4eba3d437b.bundle.js Failed to load resource: the server responded with a status of 404 ()
polyfills.b6b2cd0d4c472ac3ac12.bundle.js Failed to load resource: the server responded with a status of 404 ()
scripts.e2cc764d74d6cb8d1c42.bundle.js Failed to load resource: the server responded with a status of 404 ()
main.54e8c9147109b23af744.bundle.js Failed to load resource: the server responded with a status of 404 ()
styles.a9b0b1037568d3083749.bundle.css Failed to load resource: the server responded with a status of 404 () …Run Code Online (Sandbox Code Playgroud) 我正在尝试安装angular cli,但在消息下方。如何为nodejs v6.xx安装特定的cli cli版本,哪个角度cli版本适用于nodsjs v6.xx?
You are running version v6.x.x of node.js, which is not supported by angular CLI v6. The official Node.js version that is supported is 8.x and greater.
Run Code Online (Sandbox Code Playgroud)