Q:

Compilation problem with siunitx (returning error regarding ifnum)

I'm trying to get siunitx working. For some reason I keep getting this error:
! Missing = inserted for \ifnum.
<to be read again> 
                   -
l.3 \begin
          {document}^^M

I have tried a minimal document to make sure it is not some kind of compatibility issue. And I get that same error in the most minimal document possible.
I'm using pdfLaTeX to compile, and have tried both from TeXWorks and from bash. I'm using TeXLive, if that matters. I have also tried reinstalling siunitx, l3packages, and l3kernel. There was an issue with l3kernel before this, due to an apparently old version. But all three packages are now up to date. I've also reinstalled expl3 while trying to debug the original issue.
My minimal document is:
\documentclass{article}
\usepackage{siunitx}
\begin{document}
\end{document}

The output I get is:
This is pdfTeX, Version 3.14159265-2.6-1.40.16 (TeX Live 2015/Debian) (preloaded format=pdflatex)
restricted \write18 enabled.
entering extended mode
(./untitled-2.tex
LaTeX2e <2016/02/01>
Babel <3.9q> and hyphenation patterns for 81 language(s) loaded.
(/usr/share/texlive/texmf-dist/tex/latex/base/article.cls
Document Class: article 2014/09/29 v1.4h Standard LaTeX document class
(/usr/share/texlive/texmf-dist/tex/latex/base/size10.clo))
(/home/<name>/texmf/tex/latex/siunitx/siunitx.sty
(/home/<name>/texmf/tex/latex/l3kernel/expl3.sty
(/home/<name>/texmf/tex/latex/l3kernel/expl3-code.tex)
(/home/<name>/texmf/tex/latex/l3kernel/l3pdfmode.def))
(/home/<name>/texmf/tex/latex/l3packages/xparse/xparse.sty)
(/usr/share/texlive/texmf-dist/tex/latex/amsmath/amstext.sty
(/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsgen.sty))
(/usr/share/texlive/texmf-dist/tex/latex/tools/array.sty)
(/home/<name>/texmf/tex/latex/l3packages/l3keys2e/l3keys2e.sty)
(/usr/share/texlive/texmf-dist/tex/latex/beamer/translator/translator.sty
(/usr/share/texlive/texmf-dist/tex/latex/graphics/keyval.sty)
(/usr/share/texlive/texmf-dist/tex/latex/beamer/translator/translator-language-
mappings.tex)))
! Missing = inserted for \ifnum.
<to be read again> 
                  -
l.3 \begin
         {document}^^M
?

Does anyone have any idea what might be going wrong here?

A:

siunitx is going back to the old yyyy/mm/dd for the time being, so it should compile fine even with older LaTeX releases again (of course you still need the required versions of l3kernel etc.).

Since this question seems to have attracted a bit of attention by various people, let me explain what is going on here.
LaTeX packages normally identify themselves with their release date (and name, version number as well as a short description) to TeX. This is done in \ProvidesPackage (or \ProvidesClass for classes or \ProvidesFile for general files, see Is ProvidesFile better than ProvidesPackage or ProvidesClass). The first line of a package could look like this
\ProvidesPackage{csquotes}[2018/04/13 v5.2d context-sensitive quotations (JAW)]

The date given there can LaTeX help figure out if a package is older than a specified cut-off date with \@ifpackagelater, see Require a certain (or later) version of a package?.
Classically, all packages gave their date in the format yyyy/mm/dd.
In the April 2017 release of the LaTeX kernel support for the ISO date format yyyy-mm-dd was added. See https://www.latex-project.org/news/latex2e-news/ltnews27.pdf
Only LaTeX releases that identify themselves as LaTeX2e <2017-04-15> or newer can deal with the ISO date format, all older versions can only accept yyyy/mm/dd.
Since this is a relatively recent change not many packages have adopted the new date format, but some actively maintained packages have switched to the new format. Often these packages assume that the user keeps their TeX installation up-to-date anyway.
siunitx is one of the packages that now uses the ISO date format.
The .log file in your question shows that you still run LaTeX2e <2016/02/01>, which is too old for the ISO date format.
You will have to update your TeX distribution. See How do I update my TeX distribution? and How should one maintain and update a MiKTeX installation?
The fact that you got the new version of the package, but are stuck with an old version of the kernel means that you either updated or installed certain packages manually (a very bad idea in general), updated your installation only partially (again, a bad idea), or did not remember to update with correct permissions (MikTeX multi-user installations need to be updated as Admin and User, i.e. twice).

If you for some reason can not update your TeX distribution, there is a workaround available.
The LaTeX3 team provide a package called latexrelease that can be used to get features of newer kernel versions with older releases as well. According to https://www.latex-project.org/news/latex2e-news/ltnews27.pdf it should be enough to load the package at all because it always enables ISO dates, but to be on the safe side you can load
\RequirePackage[2017/04/15]{latexrelease}

at the very beginning of your document if you are stuck with an old LaTeX release. That will effectively 'update' your old version of the LaTeX kernel to the 2017-04-15 version.
Of course you still have to obtain latexrelease in a reasonably recent version.

The TeX Live 2015/Debian makes me think you may be stuck with an outdated (stable) version of TeX live shipped with your Linux distribution. In that case you have little control over your TeX installation and you should only install or remove packages via the official package repositories. Manual installations can lead to all sorts of problems. 
For more control over your TeX distribution you could install a vanilla TeX live: How to install "vanilla" TeXLive on Debian or Ubuntu?

