yargs / yargs/yargs-parser

use with angular/typescript

Open
#351 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
519
Forks
129
Avg merge
1h 34m
Merged PRs (30d)
1

Description

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'

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the reported import of yargs-parser in the Angular application and the build errors for fs and path under node_modules/yargs-parser/build/lib. Check whether the package supports browser-side Angular use and identify the documented outcome for this environment.

Written by the indexing model from the issue text.

Assessment

Tech stack
angular, typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.