Skip to content

use with angular/typescript #351

@kpayson

Description

@kpayson

How can I use yargs in an angular environment? It looks like it has a dependency on fs that prevents it from being used client side. Is this this true?

npm i yargs parser

then in my file

import parser from 'yargs-parser';

const argv = parser('--foo=99 --bar=9987930', {
string: ['bar']
})

and I get this error

ERROR in ./node_modules/yargs-parser/build/lib/index.js
Module not found: Error: Can't resolve 'fs' in '/Users/kenneth.paysonlabshare.org/Documents/code/labshare/ng-auth/node_modules/yargs-parser/build/lib'
ERROR in ./node_modules/yargs-parser/build/lib/index.js
Module not found: Error: Can't resolve 'path' in '/Users/kenneth.paysonlabshare.org/Documents/code/labshare/ng-auth/node_modules/yargs-parser/build/lib'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions