# Compile error with tikzexternalize after deleting all cache/build/non-tex files

I was having an issue with my cached plots not matching figure captions after moving some blocks of text around, so I wanted to clear the cached images and have tikzexternalize rebuild its cached images. To do this, I figured deleting all the [projectName]-figure* files would do the trick, but after doing so, my project would no longer build.

! Package tikz Error: Sorry, the system call 'pdflatex -halt-on-error -interact ion=batchmode -jobname "paper-figure0" "\def\tikzexternalrealjob{paper}\input{p aper}"' did NOT result in a usable output file 'paper-figure0' (expected one of .pdf:.jpg:.jpeg:.png:). Please verify that you have enabled system calls. For pdflatex, this is 'pdflatex -shell-escape'. Sometimes it is also named 'write 1 8' or something like that. Or maybe the command simply failed? Error messages c an be found in 'paper-figure0.log'. If you continue now, I'll try to typeset th e picture.

I then tried deleting all build/cache/non-tex files, figuring something was set that was causing this to break (thus only leaving my .tex and .bib and .cls files), but the error persisted. I'm using pdflatex paper to build the project (where paper.tex has my main document defined).

After reviewing the PGF Manual and using the build command they suggested (pdflatex -shell-escape paper), the project built without an error, and future builds using my old command (pdflatex paper) worked just fine.