Error: Cannot find module ‘./../node_modules/lodash/lodash.js’ Webpack

Have you added the noParse fea­ture in web­pack and started get­ting the fol­low­ing error :

Error: Can­not find mod­ule ‘./../node_modules/lodash/lodash.js’

Make the fol­low­ing change in your web­pack con­fig file to fix the issue.

// change 

module: {
    noParse: path.join(__dirname, 'node_modules'),

// to 

module: {
    noParse: /path.join(__dirname, 'node_modules')/,

Note: noParse has to be a regex.

You may also like...