Error: Cannot find module 'lodash' in angular-cli?

@codef0rmer answer is good, but if you want specific lodash dependencies and not the whole library, here is an answer with example on how to do that: https://stackoverflow.com/a/38317093/1426570


Change system-config.ts to:

const map: any = {
  'lodash': 'vendor/lodash',
};

const packages: any = {
  'lodash': {
    format: 'cjs',
    defaultExtension: 'js',
    main: 'index.js'
  }
};

And then import it as:

import 'lodash';
declare var _;

Finally use it as:

_.chunk();