Msw: Missing yargs dependency

Created on 1 Jan 2019  路  3Comments  路  Source: mswjs/msw

I tried running yarn msw create public/, which resulted in an error:

TypeError: yargs.positional is not a function
    at Object.yargs.usage.command [as builder] (/path/to/node_modules/msw/cli/msw.js:10:13)
    at Object.self.runCommand (/path/to/node_modules/yargs/lib/command.js:193:35)
    at Object.Yargs.self._parseArgs (/path/to/node_modules/yargs/yargs.js:990:30)
    at Object.get [as argv] (/path/to/node_modules/yargs/yargs.js:930:19)
    at Object.<anonymous> (/path/to/node_modules/msw/cli/msw.js:18:10)
    at Module._compile (module.js:653:30)
    at Object.Module._extensions..js (module.js:664:10)
    at Module.load (module.js:566:32)
    at tryModuleLoad (module.js:506:12)
    at Function.Module._load (module.js:498:3)
error Command failed with exit code 1.

It looks like yargs is missing as a dep from package.json in this commit: https://github.com/kettanaito/msw/commit/a8a9854114caa353f6ca45c6a9acdb232f4d0d75

bug

All 3 comments

Hello, @dashed. Thank you for reporting the issue.

Indeed, I think yargs must be listed as a save dependency, not a dev dependency of the library.
I will provide the fix and publish in the next patch version.

I've just published [email protected] with yargs properly included as a save dependency.

Could you please update and let me know if the issue is resolved?
Following the CRA example might be helpful.

Seems to work fine. Thanks! 馃憤

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lukesmurray picture lukesmurray  路  3Comments

baker-travis picture baker-travis  路  3Comments

slowselfip picture slowselfip  路  3Comments

balavishnuvj picture balavishnuvj  路  4Comments

derekr picture derekr  路  3Comments