question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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)

See original GitHub issue

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

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:5

github_iconTop GitHub Comments

3reactions
windardcommented, 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);
0reactions
zml24commented, 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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

node.js - The value of "offset" is out of range. It must be >= 0 ...
But in my case I got the error when running a find query. The error I got was pretty much identical to the...
Read more >
The value of "err" is out of range. It must be a negative integer ...
RangeError [ERR_OUT_OF_RANGE]: The value of "err" is out of range. It must be a negative integer. Received 1 at Object.
Read more >
Please help me i am getting unsigned offset error - LeetCode
In c++ if you don't initialize a variable it will contain a garbage value. And then in the for loop suppose that the...
Read more >
Solving Coding Interview Questions in Python on LeetCode ...
In this video we walk through a series of eight coding interview questions on leetcode. These are algorithms problems that cover topics ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found