我正在尝试将我的 Angular 应用程序(我使用的是 node.js 14.20.0 )部署到 GitHub 页面。我已经安装成功了:
npm i angular-cli-ghpages
但是当我跑步时:
ng deploy --base-href=https://rejkid.com.github.io/ScheduleMeFrontEnd/
按照文章链接中的建议我收到此错误:
Error: Unknown argument: base-href
你知道我做错了什么吗?
我遇到了同样的问题,但这对我有用。
在终端中运行以下命令来构建应用程序并部署到 ghpages:
npm i angular-cli-ghpages
build
代替 deploy
ng build --base-href https://[username].github.io/[repo]/
ngh --dir=dist/[project-name]
https://[username].github.io/[repo-name]/