Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.2.0] REPL - module.paths empty #4240

Closed
SpainTrain opened this issue Dec 11, 2015 · 2 comments
Closed

[5.2.0] REPL - module.paths empty #4240

SpainTrain opened this issue Dec 11, 2015 · 2 comments
Labels
duplicate Issues and PRs that are duplicates of other issues or PRs.

Comments

@SpainTrain
Copy link

In 5.1.1 and previous, requireing modules in the REPL worked. However, it appears that module.paths is empty in the REPL when using 5.2 and thus require fails. System environment and explanatory output below:

OS: Ubuntu 15.10 4.2.0-19-generic #23-Ubuntu SMP Wed Nov 11 11:39:30 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

$ echo $NODE_PATH
/usr/lib/nodejs:/usr/lib/node_modules:/usr/share/javascript:/home/spainhower/npm/lib/node_modules

spainhower at spainbuntu in ~/repos/linter-pylint on master
$ which node
/home/spainhower/npm/n/bin/node

spainhower at spainbuntu in ~/repos/linter-pylint on master
$ node -v
v5.1.1

spainhower at spainbuntu in ~/repos/linter-pylint on master
$ node
> module.paths
[ '/home/spainhower/repos/linter-pylint/repl/node_modules',
  '/home/spainhower/repos/linter-pylint/node_modules',
  '/home/spainhower/repos/node_modules',
  '/home/spainhower/node_modules',
  '/home/node_modules',
  '/node_modules' ]
> ld = require('lodash')
{ [Function: lodash]
  support: {},
  templateSettings: 
   { escape: /<%-([\s\S]+?)%>/g,
     evaluate: /<%([\s\S]+?)%>/g,
     interpolate: /<%=([\s\S]+?)%>/g,
     variable: '',
     imports: { _: [Circular] } },
  after: [Function: after],
  ary: [Function: ary],
  <...TRUNCATED FOR BREVITY...>
  include: [Function: includes],
  inject: [Function],
  sample: [Function: sample],
  VERSION: '3.10.1',
  _: [Circular] }
> 
(To exit, press ^C again or type .exit)
> 

spainhower at spainbuntu in ~/repos/linter-pylint on master
$ n 5.2

spainhower at spainbuntu in ~/repos/linter-pylint on master
 1 $ which node
/home/spainhower/npm/n/bin/node

spainhower at spainbuntu in ~/repos/linter-pylint on master
$ node -v
v5.2.0

spainhower at spainbuntu in ~/repos/linter-pylint on master
$ node
> module.paths
undefined
> ld = require('lodash')
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:6
    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)
> module.paths
[]
>
@SpainTrain SpainTrain changed the title [5.2] REPL - module.paths empty [5.2.0] REPL - module.paths empty Dec 11, 2015
@evanlucas
Copy link
Contributor

This is a known issue. It has been fixed in #4215 and hopefully a release with the fix will be out soon. Thanks for the report!

@SpainTrain
Copy link
Author

derp, I failed to search closed issues. Thanks and apologies!

@ChALkeR ChALkeR added the duplicate Issues and PRs that are duplicates of other issues or PRs. label Dec 11, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate Issues and PRs that are duplicates of other issues or PRs.
Projects
None yet
Development

No branches or pull requests

3 participants