meterscao / grunt-sprite

grunt合并雪碧图插件
MIT License
84 stars 18 forks source link

Error: Cannot find module 'gm' #3

Closed zikkeung closed 11 years ago

zikkeung commented 11 years ago

Loading "sprite.js" tasks...ERROR

Error: Cannot find module 'gm'

已经 brew install graphicsmagick ,但是不知道为什么会报错,系统是10.9

meterscao commented 11 years ago

麻烦使用gm的命令检查下gm是否安装成功

发自我的 iPhone

在 2013年11月6日,17:09,zikkeung notifications@github.com 写道:

Loading "sprite.js" tasks...ERROR

Error: Cannot find module 'gm'

已经 brew install graphicsmagick ,但是不知道为什么会报错,系统是10.9

— Reply to this email directly or view it on GitHub.

zikkeung commented 11 years ago

 ~/Downloads/grunttest/ gm GraphicsMagick 1.3.18 2013-03-10 Q8 http://www.GraphicsMagick.org/ Copyright (C) 2002-2013 GraphicsMagick Group. Additional copyrights and licenses apply to this software. See http://www.GraphicsMagick.org/www/Copyright.html for details. Usage: gm command [options ...]

Where commands include: batch - issue multiple commands in interactive or batch mode benchmark - benchmark one of the other commands compare - compare two images composite - composite images together conjure - execute a Magick Scripting Language (MSL) XML script convert - convert an image or sequence of images help - obtain usage message for named command identify - describe an image or image sequence mogrify - transform an image or sequence of images montage - create a composite image (in a grid) from separate images time - time one of the other commands version - obtain release version

zikkeung commented 11 years ago

node的版本是 v0.10.21

meterscao commented 11 years ago

从上面的结果来看,gm库是安装成功了的

meterscao commented 11 years ago

你在grunt-sprite目录里先安装各项依赖npm install,然后再运行grunt,看看返回什么

zikkeung commented 11 years ago

Er, test/publish/sprite/icon.png has been created ! test/publish/css/icon.sprite.css has been created ! Er, test/publish/sprite/icon@2x.png has been created ! test/publish/css/icon.sprite.css retina version has been created !

Done, without errors.

然后就可以了 = =#

meterscao commented 11 years ago

呃,看上去你的gmphantom库都安装成功了。 关于Loading "sprite.js" tasks...ERROR Error: Cannot find module 'gm'这个报错,可能是因为你的项目运行的目录不对,所以连任务脚本都没有载入成功。

grunt 项目运行目录里必须存在gruntfile.jspackage.json两个文件,如果没有,会自动向上级寻找。

ckrad commented 10 years ago

为什么运行之后 只copy了css 而且对css也没有任何改动