Node version v5.4.1 and I installed lodash in current directory's node_modules. And I encouter this issue where '_' seems special.
> var _ = require('lodash');
TypeError: Cannot read property 'defaults' of undefined
at REPLServer.defaultEval (repl.js:252:27)
at bound (domain.js:287:14)
at REPLServer.runBound [as eval] (domain.js:300:12)
at REPLServer.<anonymous> (repl.js:417:12)
at emitOne (events.js:82:20)
at REPLServer.emit (events.js:169:7)
at REPLServer.Interface._onLine (readline.js:210:10)
at REPLServer.Interface._line (readline.js:549:8)
at REPLServer.Interface._ttyWrite (readline.js:826:14)
> var l = require('lodash');
The underscore is a special variable that holds the result of the most recent expression. Prior to node v6.0.0, this behavior could not be disabled. However, node v6.0.0 introduced a change that allowed the underscore variable to be overwritten. So you will need to upgrade your copy of node if you want to reassign the
_ variable in the node REPL.