【问题标题】:Cannot determine project or target for Architect command angular4无法确定 Architect 命令 angular4 的项目或目标
【发布时间】:2019-01-30 14:04:34
【问题描述】:

我正在尝试运行以下命令:ng build --target=production --base-href / 但它给了我以下错误:

错误:无法确定 Architect 命令的项目或目标。 在 MergeMapSubscriber._loadWorkspaceAndArchitect.pipe.operators_1.concatMap [作为项目] (C:\training\angular4\angular-reddit\node_modules\@angular\cli\models\architect-command.js:70:27) 在 MergeMapSubscriber._tryNext (C:\training\angular4\angular-reddit\node_modules\rxjs\internal\operators\mergeMap.js:65:27) 在 MergeMapSubscriber._next (C:\training\angular4\angular-reddit\node_modules\rxjs\internal\operators\mergeMap.js:55:18) 在 MergeMapSubscriber.Subscriber.next (C:\training\angular4\angular-reddit\node_modules\rxjs\internal\Subscriber.js:64:18) 在 TapSubscriber._next (C:\training\angular4\angular-reddit\node_modules\rxjs\internal\operators\tap.js:62:26) 在 TapSubscriber.Subscriber.next (C:\training\angular4\angular-reddit\node_modules\rxjs\internal\Subscriber.js:64:18) 在 MergeMapSubscriber.notifyNext (C:\training\angular4\angular-reddit\node_modules\rxjs\internal\operators\mergeMap.js:84:26) 在 InnerSubscriber._next (C:\training\angular4\angular-reddit\node_modules\rxjs\internal\InnerSubscriber.js:25:21) 在 InnerSubscriber.Subscriber.next (C:\training\angular4\angular-reddit\node_modules\rxjs\internal\Subscriber.js:64:18) 在 MapSubscriber._next (C:\training\angular4\angular-reddit\node_modules\rxjs\internal\operators\map.js:52:26)

我是 Angular 新手。谁能帮帮我?

【问题讨论】:

  • @AniketAvhad 我尝试了这个答案,但它给了我另一个错误,这个错误:“找不到本地工作区文件('angular.json')。错误:本地工作区文件('angular.json ') 找不到。”但 angular.json 文件已经在该文件夹中
  • 尝试“ng build --prod base-href /”这个命令也针对生产
  • @AniketAvhad "在工作区中找不到项目'base-href'。错误:在工作区中找不到项目'base-href'。"
  • 如果你使用 angular 6 那么你必须使用...'ng build --configuration=production --base-href /'

标签: node.js angular


【解决方案1】:

在 Angular 6 版本中 --target 替换为 --configuration-c

使用下面的命令,

ng build --configuration=production --base-href /

ng build --c=production --base-href /

【讨论】:

    猜你喜欢
    • 2018-12-15
    • 2018-10-15
    • 2018-12-24
    • 1970-01-01
    • 1970-01-01
    • 2019-02-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多