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

Failed to run 'leetcode stat -c' (leetcode-cli/node_modules/yargs/yargs.js:1148 else throw err ^ RangeError [ERR_OUT_OF_RANGE]: The value of "offset" is out of range. It must be an integer. Received 100.28571428571429) #168

Open
indestinee opened this issue Jun 28, 2019 · 5 comments

Comments

@indestinee
Copy link

Problem Summary

failed to run 'leetcode stat -c'; but ok with 'leetcode stat -g'

How to reproduce

1. which command failed, what parameters used

leetcode stat -c

2. actual/expected output

/Users/indestinee/Code/GitHub/leetcode-cli/node_modules/yargs/yargs.js:1148
else throw err
^

RangeError [ERR_OUT_OF_RANGE]: The value of "offset" is out of range. It must be an integer. Received 100.28571428571429
at Buffer.write (buffer.js:897:5)
at showCal (/Users/indestinee/Code/GitHub/leetcode-cli/lib/commands/stat.js:171:21)
at /Users/indestinee/Code/GitHub/leetcode-cli/lib/commands/stat.js:218:24
at /Users/indestinee/Code/GitHub/leetcode-cli/lib/core.js:79:12
at Plugin.plugin.getProblems (/Users/indestinee/Code/GitHub/leetcode-cli/lib/plugins/cache.js:16:12)
at Plugin.core.filterProblems (/Users/indestinee/Code/GitHub/leetcode-cli/lib/core.js:62:8)
at Object.cmd.handler (/Users/indestinee/Code/GitHub/leetcode-cli/lib/commands/stat.js:210:8)
at Object.runCommand (/Users/indestinee/Code/GitHub/leetcode-cli/node_modules/yargs/lib/command.js:238:44)
at Object.parseArgs [as _parseArgs] (/Users/indestinee/Code/GitHub/leetcode-cli/node_modules/yargs/yargs.js:1063:30)
at Object.get [as argv] (/Users/indestinee/Code/GitHub/leetcode-cli/node_modules/yargs/yargs.js:1004:21)

3. if possible, run command with "-vv" will give more outputs of the HTTP data, do REMEMBER to delete your cookies before paste here!!

$ leetcode stat -c -vv
[TRACE] initializing all plugins
[TRACE] found plugin: cache=default
[TRACE] found plugin: leetcode=default
[TRACE] found plugin: retry=default
[TRACE] inited plugin: leetcode
[TRACE] inited plugin: retry
[TRACE] inited plugin: cache
[DEBUG] cache hit: problems.json

/Users/indestinee/Code/GitHub/leetcode-cli/node_modules/yargs/yargs.js:1148
else throw err
^

RangeError [ERR_OUT_OF_RANGE]: The value of "offset" is out of range. It must be an integer. Received 100.28571428571429
at Buffer.write (buffer.js:897:5)
at showCal (/Users/indestinee/Code/GitHub/leetcode-cli/lib/commands/stat.js:171:21)
at /Users/indestinee/Code/GitHub/leetcode-cli/lib/commands/stat.js:218:24
at /Users/indestinee/Code/GitHub/leetcode-cli/lib/core.js:79:12
at Plugin.plugin.getProblems (/Users/indestinee/Code/GitHub/leetcode-cli/lib/plugins/cache.js:16:12)
at Plugin.core.filterProblems (/Users/indestinee/Code/GitHub/leetcode-cli/lib/core.js:62:8)
at Object.cmd.handler (/Users/indestinee/Code/GitHub/leetcode-cli/lib/commands/stat.js:210:8)
at Object.runCommand (/Users/indestinee/Code/GitHub/leetcode-cli/node_modules/yargs/lib/command.js:238:44)
at Object.parseArgs [as _parseArgs] (/Users/indestinee/Code/GitHub/leetcode-cli/node_modules/yargs/yargs.js:1063:30)
at Object.get [as argv] (/Users/indestinee/Code/GitHub/leetcode-cli/node_modules/yargs/yargs.js:1004:21)

Environment

  • leetcode-cli version: 2.6.1-8dc0b2a
  • OS version: MacOS Mojave 10.14.5
  • Node version: v12.4.0
  • Npm version: 6.9.0
@zml24
Copy link

zml24 commented Jul 9, 2019

Same bug here.

@mhelvens
Copy link

Yes, confirmed.

@windard
Copy link

windard commented Oct 24, 2019

Same with you

@windard
Copy link

windard commented Oct 24, 2019

change in /usr/local/Cellar/node/11.10.1/lib/node_modules/leetcode-cli/lib/commands/stat.js:172 can solve this problem

    if (j >= 0) buf.write(MONTHS[d.month()], j|0);

@zml24
Copy link

zml24 commented Oct 24, 2019

change in /usr/local/Cellar/node/11.10.1/lib/node_modules/leetcode-cli/lib/commands/stat.js:172 can solve this problem

    if (j >= 0) buf.write(MONTHS[d.month()], j|0);

awesome. thanks.

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

4 participants