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

Unable to require module inside eval file #44

Open
lastcoolnameleft opened this issue Apr 14, 2016 · 0 comments
Open

Unable to require module inside eval file #44

lastcoolnameleft opened this issue Apr 14, 2016 · 0 comments

Comments

@lastcoolnameleft
Copy link

If I try nesh.js as:

.require nconf

I get:

[tfalgout@beyondinto-lm necs]$ nesh -b --eval nesh.js
Babel 5.8.38 on Node v5.2.0
Type .help for more information
babel> Error in plugin eval:
SyntaxError: Unexpected token .
    at Object.exports.runInThisContext (vm.js:54:16)
    at exports.postStart (/usr/local/lib/node_modules/nesh/lib/plugins/eval.js:24:19)
    at callPluginMethod (/usr/local/lib/node_modules/nesh/lib/nesh.js:73:9)
    at process (/usr/local/lib/node_modules/nesh/lib/nesh.js:40:16)
    at /usr/local/lib/node_modules/nesh/lib/nesh.js:52:18
    at callPluginMethod (/usr/local/lib/node_modules/nesh/lib/nesh.js:78:14)
    at process (/usr/local/lib/node_modules/nesh/lib/nesh.js:40:16)
    at process (/usr/local/lib/node_modules/nesh/lib/nesh.js:55:16)
    at processPlugins (/usr/local/lib/node_modules/nesh/lib/nesh.js:58:12)
    at /usr/local/lib/node_modules/nesh/lib/nesh.js:105:14
undefined
babel>

If I try:

const nconf = require('nconf');

I get:

[tfalgout@beyondinto-lm necs]$ nesh -b --eval nesh.js
Babel 5.8.38 on Node v5.2.0
Type .help for more information
babel> Error in plugin eval:
Error: Cannot find module 'nconf'
    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 evalmachine.<anonymous>:1:15
    at Object.exports.runInThisContext (vm.js:55:17)
    at exports.postStart (/usr/local/lib/node_modules/nesh/lib/plugins/eval.js:24:19)
    at callPluginMethod (/usr/local/lib/node_modules/nesh/lib/nesh.js:73:9)
    at process (/usr/local/lib/node_modules/nesh/lib/nesh.js:40:16)
    at /usr/local/lib/node_modules/nesh/lib/nesh.js:52:18
undefined
.exit

Is there something I'm missing?

Proof that I do have the nconf module:

[tfalgout@beyondinto-lm necs]$ nesh -b
Babel 5.8.38 on Node v5.2.0
Type .help for more information
babel> .require nconf
nconf = require("nconf")
nconf = require("./nconf")
babel> nconf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant