【问题标题】:Bootstrap css files are not found in tmp folder while Ember buildEmber 构建时在 tmp 文件夹中找不到引导 css 文件
【发布时间】:2017-02-23 20:27:07
【问题描述】:

ember 构建时,CSS 文件不会在 app/styles 目录中生成。 Ember Build 时出现的错误如下:

    "C:\Program Files\Java\jdk1.8.0_25\bin\java" -Dmaven.home=D:\JavaProjects\apache-maven-3.0.3 -Dclassworlds.conf=D:\JavaProjects\apache-maven-3.0.3\bin\m2.conf -Didea.launcher.port=7534 "-Didea.launcher.bin.path=D:\IntelliJ IDEA 14.1.7\bin" -Dfile.encoding=windows-1252 -classpath "D:\JavaProjects\apache-maven-3.0.3\boot\plexus-classworlds-2.4.jar;D:\IntelliJ IDEA 14.1.7\lib\idea_rt.jar" com.intellij.rt.execution.application.AppMain org.codehaus.classworlds.Launcher -Didea.version=14.1.7
-DskipTests=true clean install
    [INFO] Scanning for projects...
    [INFO]                                                                         
    [INFO] ------------------------------------------------------------------------
    [INFO] Building CMTEmberUI 1.0.0-SNAPSHOT
    [INFO] ------------------------------------------------------------------------
    [INFO] 
    [INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) @ CMTEmberUI ---
    [INFO] Deleting D:\sigdev\IntegrateCareManagement\CMTEmberUI\target
    [INFO] 
    [INFO] --- build-helper-maven-plugin:1.5:maven-version (add-mvn-version) @ CMTEmberUI ---
    [INFO] 
    [INFO] --- build-helper-maven-plugin:1.5:parse-version (add-mvn-version) @ CMTEmberUI ---
    [INFO] 
    [INFO] --- maven-dependency-plugin:2.8:unpack (copy) @ CMTEmberUI ---
    [INFO] Configured Artifact: org.jacoco:org.jacoco.agent:0.7.2.201409121644:jar
    [INFO] Unpacking C:\Users\dt202197\.m2\repository\org\jacoco\org.jacoco.agent\0.7.2.201409121644\org.jacoco.agent-0.7.2.201409121644.jar to D:\sigdev\IntegrateCareManagement\CMTEmberUI\target\jacoco with includes "" and excludes ""
    [INFO] 
    [INFO] --- maven-resources-plugin:2.6:copy-resources (liquibase) @ CMTEmberUI ---
    [INFO] Using 'UTF-8' encoding to copy filtered resources.
    [INFO] skip non existing resourceDirectory D:\sigdev\IntegrateCareManagement\CMTEmberUI\src\main\resources
    [INFO] 
    [INFO] --- maven-resources-plugin:2.6:copy-resources (liquibase-test) @ CMTEmberUI ---
    [INFO] Using 'UTF-8' encoding to copy filtered resources.
    [INFO] skip non existing resourceDirectory D:\sigdev\IntegrateCareManagement\CMTEmberUI\src\test\resources
    [INFO] 
    [INFO] --- maven-surefire-plugin:2.11:test (unit-tests) @ CMTEmberUI ---
    [INFO] Tests are skipped.
    [INFO] 
    [INFO] --- maven-antrun-plugin:1.7:run (ember-cli) @ CMTEmberUI ---
    [INFO] Executing tasks

    building:
         [echo] *** NPM INSTALL ***
         [echo] *** BOWER INSTALL ***
         [echo] *** EMBER production BUILD ***
         [exec] 
         [exec] Running without elevated rights. Running Ember CLI "as Administrator" increases performance significantly.
         [exec] See ember-cli.com/user-guide/#windows for details.
         [exec] 
         [exec] cleaning up...
         [exec] Build failed.
         [exec] File: assets/vendor.css
         [exec] The Broccoli Plugin: [broccoli-persistent-filter:CleanCSSFilter] failed with:
         [exec] Error: 3 errors found while optimizing CSS with clean-css:
         [exec]   1. Ignoring local source map at "D:\sigdev\IntegrateCareManagement\CMTEmberUI\cmt\tmp\broccoli_persistent_filterclean_cssfilter-input_base_path-daTKhwFh.tmp\assets\bootstrap.min.css.map" as resource is missing.
         [exec]   2. Ignoring local source map at "D:\sigdev\IntegrateCareManagement\CMTEmberUI\cmt\tmp\broccoli_persistent_filterclean_cssfilter-input_base_path-daTKhwFh.tmp\assets\bootstrap-theme.min.css.map" as resource is missing.
         [exec]   3. Ignoring local source map at "D:\sigdev\IntegrateCareManagement\CMTEmberUI\cmt\tmp\broccoli_persistent_filterclean_cssfilter-input_base_path-daTKhwFh.tmp\assets\bootstrap.css.map" as resource is missing.
         [exec] 
         [exec] clean-css dangerously ignores these errors but broccoli-clean-css doesn't, because it's much more reasonable to update the CSS to fix all problems than to pretend that you didn't see the errors.
         [exec]     at minify (D:\sigdev\IntegrateCareManagement\CMTEmberUI\cmt\node_modules\clean-css-promise\index.js:63:18)
         [exec]     at D:\sigdev\IntegrateCareManagement\CMTEmberUI\cmt\node_modules\clean-css\lib\clean.js:107:9
         [exec]     at Object.callback (D:\sigdev\IntegrateCareManagement\CMTEmberUI\cmt\node_modules\clean-css\lib\reader\read-sources.js:29:9)
         [exec]     at doApplySourceMaps (D:\sigdev\IntegrateCareManagement\CMTEmberUI\cmt\node_modules\clean-css\lib\reader\apply-source-maps.js:61:23)
         [exec]     at D:\sigdev\IntegrateCareManagement\CMTEmberUI\cmt\node_modules\clean-css\lib\reader\apply-source-maps.js:86:12
         [exec]     at extractInputSourceMapFrom (D:\sigdev\IntegrateCareManagement\CMTEmberUI\cmt\node_modules\clean-css\lib\reader\apply-source-maps.js:122:14)
         [exec]     at fetchAndApplySourceMap (D:\sigdev\IntegrateCareManagement\CMTEmberUI\cmt\node_modules\clean-css\lib\reader\apply-source-maps.js:79:10)
         [exec]     at doApplySourceMaps (D:\sigdev\IntegrateCareManagement\CMTEmberUI\cmt\node_modules\clean-css\lib\reader\apply-source-maps.js:57:14)
         [exec]     at D:\sigdev\IntegrateCareManagement\CMTEmberUI\cmt\node_modules\clean-css\lib\reader\apply-source-maps.js:86:12
         [exec]     at extractInputSourceMapFrom (D:\sigdev\IntegrateCareManagement\CMTEmberUI\cmt\node_modules\clean-css\lib\reader\apply-source-maps.js:122:14)
         [exec] 
         [exec] The broccoli plugin was instantiated at: 
         [exec]     at CleanCSSFilter.Plugin (D:\sigdev\IntegrateCareManagement\CMTEmberUI\cmt\node_modules\broccoli-plugin\index.js:7:31)
         [exec]     at CleanCSSFilter.Filter [as constructor] (D:\sigdev\IntegrateCareManagement\CMTEmberUI\cmt\node_modules\broccoli-persistent-filter\index.js:62:10)
         [exec]     at CleanCSSFilter (D:\sigdev\IntegrateCareManagement\CMTEmberUI\cmt\node_modules\broccoli-clean-css\index.js:29:5)
         [exec]     at module.exports.preprocessMinifyCss (D:\sigdev\IntegrateCareManagement\CMTEmberUI\cmt\node_modules\ember-cli-preprocess-registry\preprocessors.js:112:12)
         [exec]     at EmberApp.styles (D:\sigdev\IntegrateCareManagement\CMTEmberUI\cmt\node_modules\ember-cli\lib\broccoli\ember-app.js:1377:23)
         [exec]     at EmberApp.toArray (D:\sigdev\IntegrateCareManagement\CMTEmberUI\cmt\node_modules\ember-cli\lib\broccoli\ember-app.js:1675:10)
         [exec]     at EmberApp.toTree (D:\sigdev\IntegrateCareManagement\CMTEmberUI\cmt\node_modules\ember-cli\lib\broccoli\ember-app.js:1696:30)
         [exec]     at module.exports (D:\sigdev\IntegrateCareManagement\CMTEmberUI\cmt\ember-cli-build.js:26:14)
         [exec]     at CoreObject.setupBroccoliBuilder (D:\sigdev\IntegrateCareManagement\CMTEmberUI\cmt\node_modules\ember-cli\lib\models\builder.js:84:19)
         [exec]     at CoreObject.init (D:\sigdev\IntegrateCareManagement\CMTEmberUI\cmt\node_modules\ember-cli\lib\models\builder.js:64:10)
         [exec] 
         [exec] 
         [echo] *** EMBER COMMAND RESULTS ***
         [echo] 1
         [exec] Result: 1
    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD FAILURE
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 22:30.494s
    [INFO] Finished at: Fri Feb 24 01:47:06 IST 2017
    [INFO] Final Memory: 11M/143M
    [INFO] ------------------------------------------------------------------------
    [ERROR] Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:1.7:run (ember-cli) on project CMTEmberUI: An Ant BuildException has occured: unless=cmdsuccess
    [ERROR] around Ant part ...<fail unless="cmdsuccess"/>... @ 42:30 in D:\sigdev\IntegrateCareManagement\CMTEmberUI\target\antrun\build-building.xml
    [ERROR] -> [Help 1]
    [ERROR] 
    [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
    [ERROR] Re-run Maven using the -X switch to enable full debug logging.
    [ERROR] 
    [ERROR] For more information about the errors and possible solutions, please read the following articles:
    [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

    Process finished with exit code 1

我是 ember 新手,无法找到此错误背后的原因。 Ember 无法生成 CSS 文件。

我尝试通过 bower install 手动添加 ember-cli-shims 和引导程序,但问题仍然没有得到解决。

【问题讨论】:

    标签: css twitter-bootstrap ember.js


    【解决方案1】:

    ember-cli-preprocessor-registry 3.1.0 (details) 中有一些回归。 3.1.1 已经发布,现在一切正常。您可能需要删除 node_modules 目录并运行 npm install 以更新依赖项。

    【讨论】:

    • 您能否告知如何检查 ember-cli-preprocessor-registry 版本?
    • node_modules/ember-cli-preprocess-registry/package.json:寻找“版本”属性。
    • 谢谢@chekmare,我已经检查了 ember-cli-preprocessor-registry 版本,它被提到为"raw": "ember-cli-preprocess-registry@^3.0.0" 你能否告知如何升级 ember-cli-preprocessor-registry 版本。供大家参考,我系统当前的ember版本是:ember-cli: 2.10.0 node: 6.10.0 os: win32 x64 npm: 3.10.10
    • "raw" 并不是真正的版本,但无论如何您不必做任何特别的事情。只需删除 node_modules 目录并运行“npm install”。
    • 我已经尝试过了,并将 mvn clean install 安装到包含 ember build 的完整项目中;但是没有创建css文件。但是没有出现错误消息。
    【解决方案2】:

    我试过了,发现生成的cmt css文件(dist/assets/cmt.css)是0字节。

    building:
         [echo] *** NPM INSTALL ***
         [echo] *** BOWER INSTALL ***
         [echo] *** EMBER production BUILD ***
         [exec]
         [exec] Running without elevated rights. Running Ember CLI "as Administrator" increases performance significantly.
         [exec] See ember-cli.com/user-guide/#windows for details.
         [exec]
         [exec] [WARN] (broccoli-uglify-sourcemap) Minifying: `assets/vendor.js` took: 45296ms (more than 20,000ms)
         [exec] cleaning up...
         [exec] Built project successfully. Stored in "dist/".
         [exec] File sizes:
         [exec]  - dist/assets/cmt.css: 0 B
         [exec]  - dist/assets/cmt.js: 98.14 KB (11.83 KB gzipped)
         [exec]  - dist/assets/vendor.css: 170.32 KB (29.94 KB gzipped)
         [exec]  - dist/assets/vendor.js: 1.11 MB (289.25 KB gzipped)
         [echo] *** EMBER COMMAND RESULTS ***
         [echo] 0
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2023-04-10
      • 2021-12-08
      • 1970-01-01
      • 2019-07-09
      • 2022-09-29
      • 1970-01-01
      • 1970-01-01
      • 2023-03-24
      相关资源
      最近更新 更多