Lodash module not found + webpack

Viewed 10430

I try use the library ladash but I´m getting the next error:

Module not found: Error: Can't resolve 'lodash' in

I import the library as:

import _ from 'lodash';

This is the webpack config:

{
  loader: 'babel-loader',
  test: /\.js$/,
  exclude: /node_modules/,
  options: {
     plugins: ['lodash'],
     presets: [['env', { modules: false, targets: { node: 4 } }]]
  }
}

......
......
plugins: [
   new LodashModuleReplacementPlugin,
   new webpack.optimize.UglifyJsPlugin
]

and this is my package json dependencies:

enter image description here

1 Answers

Running npm install will solve your error!

Related