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 use _.toInteger() in n_ repl - how can I force lodash major version 4? #22

Closed
paul42 opened this issue Feb 6, 2018 · 3 comments

Comments

@paul42
Copy link

paul42 commented Feb 6, 2018

Hey @borisdiakur love your library, but I think I'm doing something wrong, I can't get _.toInteger() to work, I get an error - when I install globally I think it's still doing lodash major v 3?

paul42$ npm install -g n_
npm WARN deprecated tar.gz@1.0.7: ⚠️  WARNING ⚠️ tar.gz module has been deprecated and your application is vulnerable. Please use tar module instead: https://npmjs.com/tar
/Users/paul42/.nvm/versions/node/v8.7.0/bin/n_3 -> /Users/paul42/.nvm/versions/node/v8.7.0/lib/node_modules/n_/bin/n_3
/Users/paul42/.nvm/versions/node/v8.7.0/bin/n_ -> /Users/paul42/.nvm/versions/node/v8.7.0/lib/node_modules/n_/bin/n_

> n_@1.4.5 postinstall /Users/paul42/.nvm/versions/node/v8.7.0/lib/node_modules/n_
> npm pack lodash@^3 && targz extract lodash-3.*.tgz extraneous/lodash3

lodash-3.10.1.tgz
+ n_@1.4.5
added 26 packages in 3.564s
paul42$ n_4
-bash: n_4: command not found
paul42$ n_3
n_ > _.toInteger('4')
TypeError: _.toInteger is not a function
    at repl:1:3
    at ContextifyScript.Script.runInContext (vm.js:59:29)
    at REPLServer.defaultEval (repl.js:241:29)
    at bound (domain.js:301:14)
    at REPLServer.runBound [as eval] (domain.js:314:12)
    at Array.onLine (repl.js:440:10)
    at REPLServer.<anonymous> (/Users/paul42/.nvm/versions/node/v8.7.0/lib/node_modules/n_/lib/n_.js:75:12)
    at REPLServer.wrapper (/Users/paul42/.nvm/versions/node/v8.7.0/lib/node_modules/n_/extraneous/lodash3/package/index.js:3592:19)
    at emitOne (events.js:115:13)
    at REPLServer.emit (events.js:210:7)
n_ > 

let me know if there is a certain area I can look at to submit a pull request. thanks for the awesome library!

@borisdiakur
Copy link
Owner

Hi Paul. There is currently no n_4 command. Not until lodash v5 is out. The n_3 command starts the REPL with lodash v3 included, which doesn’t have the toInteger method. Have you tried using the command n_ (need to ask because I do not see it above)?

Here is my output:

$ npm i -g n_
npm WARN deprecated tar.gz@1.0.7: ⚠️  WARNING ⚠️ tar.gz module has been deprecated and your application is vulnerable. Please use tar module instead: https://npmjs.com/tar
/usr/local/bin/n_ -> /usr/local/lib/node_modules/n_/bin/n_
/usr/local/bin/n_3 -> /usr/local/lib/node_modules/n_/bin/n_3

> n_@1.4.5 postinstall /usr/local/lib/node_modules/n_
> npm pack lodash@^3 && targz extract lodash-3.*.tgz extraneous/lodash3

lodash-3.10.1.tgz
+ n_@1.4.5
added 26 packages in 11.852s
$ n_
n_ > _.toInteger('123')
123
n_ > 

@paul42
Copy link
Author

paul42 commented Feb 7, 2018

@borisdiakur thanks for taking the time to reply - I must've done something wrong previously or been in a bad state, I uninstalled, reinstalled and the command worked fine! user error. Sorry for opening the issue.

Thanks so much for your time and the great library!

@paul42 paul42 closed this as completed Feb 7, 2018
@borisdiakur
Copy link
Owner

No problem, you’re welcome!

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

2 participants