I had the latest angular-cli installed globally and my project was building successfully.
While reading a suggested solution for another issue, (https://github.com/angular/angular-cli/issues/917) I uninstalled the global angular-cli and installed it as a dev-dependency.
That other issue wasn't solved so I uninstalled the dev-dependency and reinstalled angular-cli globally once again. Now when I try to do an ng build I'm getting the error:
You have to be inside an angular-cli project in order to use the build command
My angular-cli version did not change. Why isn't my project being recognised as an angular-cli project??
Same as John Pankowicz answer, but in my case I had to run
npm install -g @angular/cli@latest
for the versions to match.