Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angularjs/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angularjs grunt生成因警告而中止;未写入目标,因为缩小的HTML为空;及;分析错误:";_Angularjs_Gruntjs_Yeoman - Fatal编程技术网

Angularjs grunt生成因警告而中止;未写入目标,因为缩小的HTML为空;及;分析错误:";

Angularjs grunt生成因警告而中止;未写入目标,因为缩小的HTML为空;及;分析错误:";,angularjs,gruntjs,yeoman,Angularjs,Gruntjs,Yeoman,我使用的是Yeoman(),我通常只是跑步 grunt build 为了缩小并上传我的AngularJS应用到服务器。然而,由于某种原因,我得到了一份工作 >> Destination not written because minified HTML was empty. 我以前没有遇到过这个问题,直到现在,我还没有更改我的Grunt文件。似乎其他所有内容都在缩小,即使是同一/views目录中的其他html文件。我在这篇文章()中读到了关于SCSS的一些内容,但我似乎无法指

我使用的是Yeoman(),我通常只是跑步

grunt build
为了缩小并上传我的AngularJS应用到服务器。然而,由于某种原因,我得到了一份工作

  >> Destination not written because minified HTML was empty.
我以前没有遇到过这个问题,直到现在,我还没有更改我的Grunt文件。似乎其他所有内容都在缩小,即使是同一/views目录中的其他html文件。我在这篇文章()中读到了关于SCSS的一些内容,但我似乎无法指出问题所在。为什么我不能缩小我的dsit/views/main.html?这是航站楼里的样子

  Running "htmlmin:dist" (htmlmin) task
  Minified dist/404.html 3.53 kB → 3.39 kB
  Minified dist/index.html 2.5 kB → 2.31 kB
  Minified dist/views/about.html 31 B → 30 B
  >> Destination not written because minified HTML was empty.
  Minified dist/views/explore.html 33 B → 32 B
  Warning: dist/views/main.html
  Parse Error: <a ng-click="nextCampaign()" class"nav-button">
      <i class="fa fa-chevron-right fa-2x"></i>
    </a>
  </nav>......... more code
运行“htmlmin:dist”(htmlmin)任务
缩小的dist/404.html 3.53 kB→ 3.39 kB
缩小的dist/index.html 2.5 kB→ 2.31 kB
缩小的dist/views/about.html 31 B→ 30 B
>>未写入目标,因为缩小的HTML为空。
缩小距离/views/explore.html 33 B→ 32 B
警告:dist/views/main.html
分析错误:
......... 更多代码
下面是我的Grunt文件中的“htmlmin:dist”,它给出了错误

  htmlmin: {
  dist: {
    options: {
      collapseWhitespace: true,
      conservativeCollapse: true,
      collapseBooleanAttributes: true,
      removeCommentsFromCDATA: true,
      removeOptionalTags: true
    },
    files: [{
      expand: true,
      cwd: '<%= yeoman.dist %>',
      src: ['*.html', 'views/{,*/}*.html'],
      dest: '<%= yeoman.dist %>'
    }]
  }
},
htmlmin:{
地区:{
选项:{
拼贴空白:对,
保守派:是的,
collapseBooleanAttributes:没错,
removeCommentsFromCDATA:true,
removeOptionalTags:true
},
档案:[{
是的,
cwd:“”,
src:['*.html','views/{,*/}*.html'],
目标:“”
}]
}
},
下面是它抱怨的main.html组件

  Parse Error: <a ng-click="nextCampaign()" class"nav-button">
      <i class="fa fa-chevron-right fa-2x"></i>
    </a>
  </nav>

  <nav class="modal-previous hidden-mobile">
    <a ng-click="previousCampaign()"class"nav-button">
      <i class="fa fa-chevron-left fa-2x"></i>
    </a>
  </nav>
分析错误:

找到了答案。这只是一个简单的错误,我在中间漏掉了一个“=”

 class"nav-button" 
我只是把它改成了

class="nav-button"
一切都很好。如果您遇到此错误,请检查终端告诉您存在错误的线路

 Parse Error: ...html...
有时候就这么简单