tonymx227
tonymx227

Reputation: 5451

Lodash doesn't work with NPM

I get an issue using lodash with NPM.

My code :

var _ = require('lodash');
console.log(_.chunk(['1','2','3','4'], 3));

Response : _.chunk is not a function

Lodash version : latest : 4.17.4

Upvotes: 1

Views: 638

Answers (1)

Sohum Sachdev
Sohum Sachdev

Reputation: 1397

The example you have included is syntactically correct. I would suggest that you make sure that the package is installed correctly.

$ npm i -g npm
$ npm i --save lodash

Upvotes: 1

Related Questions