generator-rn-toolbox 是一个 react native 软件 icon 图标替换插件,可是我在使用的时候一直在报错:

? We are looking for feedback on how to improve rn-toolbox, please take 2 minutes to answer this form: https://forms.gle/dqAn41iBmeQowTf96
? Name of your react-native project test

events.js:174
      throw er; // Unhandled 'error' event
      ^
Error: Could not execute GraphicsMagick/ImageMagick: identify "-ping" "-format" "%wx%h" "icon.png" this most likely means the gm/convert binaries can't be found
    at ChildProcess.<anonymous> (/Users/bin/.nvm/versions/node/v10.16.0/lib/node_modules/generator-rn-toolbox/node_modules/gm/lib/command.js:232:12)
    at ChildProcess.emit (events.js:198:13)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:246:12)
    at onErrorNT (internal/child_process.js:415:16)
    at process._tickCallback (internal/process/next_tick.js:63:19)
Emitted 'error' event at:
    at Immediate.setImmediate (/Users/bin/.nvm/versions/node/v10.16.0/lib/node_modules/generator-rn-toolbox/node_modules/yeoman-generator/lib/index.js:406:18)
    at runCallback (timers.js:705:18)
    at tryOnImmediate (timers.js:676:5)
    at processImmediate (timers.js:658:5)

看报错是因为没有 GraphicsMagick/ImageMagick 在 mac 上我们直接使用 brew 安装一下就好了…

brew install imagemagick