簡體   English   中英

為什么grunt無法依賴imagemin?

[英]why grunt is failing at imagemin dependency?

我正在使用節點版本0.12.2和npm版本3.3.6。 我正在使用yeoman工具創建角度應用程序。 當我運行grunt時,它在imagemin依賴關系中終止。 我嘗試了命令npm install -g grunt-contrib-imageminnpm install imagemin imagemin.Still我npm install imagemin遇到相同的錯誤:

Execution Time (2015-12-27 19:17:59 UTC)
    loading tasks          87ms  ▇▇ 3%
    loading grunt-svgmin     2s  ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 75%
    svgmin:dist           566ms  ▇▇▇▇▇▇▇▇▇ 21%
    Total 2.6s
        Warning: Running "imagemin:dist" (imagemin) task
    Fatal error: Cannot read property 'contents' of undefined
     Aborted due to warnings.

這是我的package.json:

{
  "name": "cordapp",
  "private": true,
  "devDependencies": {
    "grunt": "^0.4.5",
    "grunt-angular-templates": "^0.5.7",
    "grunt-autoprefixer": "^2.0.0",
    "grunt-concurrent": "^1.0.0",
    "grunt-contrib-clean": "^0.6.0",
    "grunt-contrib-concat": "^0.5.0",
    "grunt-contrib-connect": "^0.9.0",
    "grunt-contrib-copy": "^0.7.0",
    "grunt-contrib-cssmin": "^0.12.0",
    "grunt-contrib-htmlmin": "^0.4.0",
    "grunt-contrib-imagemin": "^0.9.2",
    "grunt-contrib-jshint": "^0.11.0",
    "grunt-contrib-uglify": "^0.7.0",
    "grunt-contrib-watch": "^0.6.1",
    "grunt-filerev": "^2.1.2",
    "grunt-google-cdn": "^0.4.3",
    "grunt-karma": "*",
    "grunt-newer": "^1.1.0",
    "grunt-ng-annotate": "^0.9.2",
    "grunt-svgmin": "^2.0.0",
    "grunt-usemin": "^3.0.0",
    "grunt-wiredep": "^2.0.0",
    "jit-grunt": "^0.9.1",
    "jshint-stylish": "^1.0.0",
    "karma-jasmine": "*",
    "karma-phantomjs-launcher": "*",
    "time-grunt": "^1.0.0"
  },
  "engines": {
    "node": ">=0.10.0"
  },
  "scripts": {
    "test": "grunt test"
  }
}

任何幫助,將不勝感激。

清理您的npm現金並重新安裝grunt-contrib-imagemin

npm緩存清理&& npm安裝grunt-contrib-imagemin

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM