You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm used to being able to cd into a project directory, start a REPL, and require modules that are installed in the node_modules directory. It works in 5.1.1 and previous versions of node I've used, but it stopped working in 5.2.0.
chris@Truth:/tmp$ mkdir foo
chris@Truth:/tmp$ cd foo
chris@Truth:/tmp/foo$ npm i lodash
/tmp/foo
└── lodash@3.10.1
npm WARN enoent ENOENT: no such file or directory, open '/tmp/foo/package.json'
npm WARN foo No description
npm WARN foo No repository field.
npm WARN foo No README data
npm WARN foo No license field.
chris@Truth:/tmp/foo$ ls node_modules/
lodash
chris@Truth:/tmp/foo$ uname -a
Linux Truth 4.2.0-19-generic #23-Ubuntu SMP Wed Nov 11 11:39:30 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
chris@Truth:/tmp/foo$ node -v
v5.2.0
chris@Truth:/tmp/foo$ npm -v
3.5.1
chris@Truth:/tmp/foo$ NODE_DEBUG=module node
> var l = require('lodash');
MODULE 13279: Module._load REQUEST lodash parent: <repl>
MODULE 13279: looking for "lodash" in ["/home/chris/.node_modules","/home/chris/.node_libraries","/usr/local/lib/node"]
Error: Cannot find module 'lodash'
at Function.Module._resolveFilename (module.js:327:15)
at Function.Module._load (module.js:278:25)
at Module.require (module.js:355:17)
at require (internal/module.js:13:17)
at repl:1:9
at REPLServer.defaultEval (repl.js:252:27)
at bound (domain.js:281:14)
at REPLServer.runBound [as eval] (domain.js:294:12)
at REPLServer.<anonymous> (repl.js:417:12)
at emitOne (events.js:83:20)
I'm used to being able to cd into a project directory, start a REPL, and require modules that are installed in the node_modules directory. It works in 5.1.1 and previous versions of node I've used, but it stopped working in 5.2.0.
And then here's it working in 5.1.1:
The text was updated successfully, but these errors were encountered: