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

TypeError: def.isBoolean is not a function #42

Closed
ronyad opened this issue Feb 28, 2017 · 4 comments
Closed

TypeError: def.isBoolean is not a function #42

ronyad opened this issue Feb 28, 2017 · 4 comments

Comments

@ronyad
Copy link

ronyad commented Feb 28, 2017

Hey Im using node 6.3.0
When I ran the following command

$ node RecordingSourceOnly.js -t 5

where RecordingSourceOnly.js is

const commandLineArgs = require('command-line-args')

const optionDefinitions = [
    { name: 'verbose', alias: 'v', type: Boolean },
    { name: 'src', type: String, multiple: true, defaultOption: true },
    { name: 'timeout', alias: 't', type: Number }
]
const options = commandLineArgs(optionDefinitions)

I got

    if (def.isBoolean()) {
            ^

TypeError: def.isBoolean is not a function
    at Output.set (/Users/ron.yadgar/Documents/Repositories/liveDVR/node_modules/command-line-args/lib/output.js:67:13)
    at argv.forEach.arg (/Users/ron.yadgar/Documents/Repositories/liveDVR/node_modules/command-line-args/lib/command-line-args.js:50:27)
    at Argv.forEach (native)
    at commandLineArgs (/Users/ron.yadgar/Documents/Repositories/liveDVR/node_modules/command-line-args/lib/command-line-args.js:48:8)
    at Object.<anonymous> (/Users/ron.yadgar/Documents/Repositories/liveDVR/lib/recording/RecordingSourceOnly.js:32:17)
    at Module._compile (module.js:541:32)
    at Object.Module._extensions..js (module.js:550:10)
    at Module.load (module.js:458:32)
    at tryModuleLoad (module.js:417:12)
    at Function.Module._load (module.js:409:3)
@75lb
Copy link
Owner

75lb commented Feb 28, 2017

i can't reproduce your issue - when i run the same code it works fine.. please try deleting then re-installing all npm modules.

@75lb 75lb closed this as completed Feb 28, 2017
@ronyad
Copy link
Author

ronyad commented Feb 28, 2017

Ok I found the problem
I'm using also q-io/fs module , therefore the bug reproduce if commandLineArgs is called after qio defined, i.e.

const qio = require('q-io/fs');
const options = commandLineArgs(optionDefinitions) //throw error

But If i changed the the order, i.e.

const options = commandLineArgs(optionDefinitions)
const qio = require('q-io/fs');

Then It works.
I case its matter, i'm using OS x

@75lb
Copy link
Owner

75lb commented Feb 28, 2017

confirmed - thanks for letting me know what caused the issue.. I recommend you no longer use q-io until this issue is fixed.

@75lb
Copy link
Owner

75lb commented Feb 28, 2017

consider this lightweight fs library which uses promises: https://github.com/75lb/fs-then-native

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