When you run a ng build in the angular 2, latest angular-cli automatically runs with --aot parameter (ahead of a time compilation), so it is trying to optimize the code. You are having the package which is not yet compatible for the optimizing. So you need to update the packages. Most probably your packages that has
**forRoot()** in the app.module.ts
I recommend you to update all packages.
Easy way to update your package is to use the ncu npm package as in below,
npm install -g npm-check-updates
ncu for the display
ncu -u for the re-writing your package.json
npm install to update the packages
If above did not work, for you then you might need to update your code for aot compliance.