How to fix command not found when install Strapi

Recently I tried Strapi but found an issue: I got autoreconf: command not found on install and I couldn't find any info or troubleshooting on the official guide. Are you dealing with the same? Keep reading 👇

The error ⚠️

I got:

[5/5] 🔨  Building fresh packages...
[9/10] ⠈ cwebp-bin
[7/10] ⠈ pngquant-bin
[6/10] ⠈ optipng-bin
[4/10] ⠈ gifsicle
error /Users/david/strapi/node_modules/gifsicle: Command failed.
Exit code: 1
Command: node lib/install.js
Arguments:
Directory: /Users/david/strapi/node_modules/gifsicle
Output:
⚠️ connect ECONNREFUSED 127.0.0.1:443
  ⚠️ gifsicle pre-build test failed
  ℹ compiling from source
  ✖ Error: Command failed: /bin/sh -c autoreconf -ivf
/bin/sh: autoreconf: command not found

When tried to install Strapi running yarn create strapi-app my-project --quickstart as I found on the Getting started guide

So it looks like the issue is about the dependency autoreconf of gifsicle

How to fix it ✨

On MacOSX, run:

brew install libtool automake autoconf nasm

On Ubuntu/Debian, run:

sudo apt-get install libtool automake autoconf nasm

This will install in your system some libraries that the previous dependencies require.

Would be nice if Strapi mention it as install requirement 🙂

Test 💎

After install them, just try again and it should install correctly:

[3/5] 🚚  Fetching packages...
[4/5] 🔗  Linking dependencies...
warning "strapi-admin > bootstrap@4.3.1" has unmet peer dependency "jquery@1.9.1 - 3".
warning "strapi-admin > bootstrap@4.3.1" has unmet peer dependency "popper.js@^1.14.7".
warning "strapi-admin > @buffetjs/styles > react-dates@21.5.0" has unmet peer dependency "react-with-direction@^1.3.1".
warning "strapi-plugin-users-permissions > grant-koa@4.6.4" has unmet peer dependency "koa@>=0.x.x".
warning "strapi-hook-bookshelf > bookshelf@0.15.1" has incorrect peer dependency "knex@>=0.13.0 <0.18.0".
[5/5] 🔨  Building fresh packages...
success Saved lockfile.
✨  Done in 157.47s.

It works for you? Any question?
Leave a comment below 👋

David Burgos

Read more posts by this author.