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

SyntaxError: Unexpected string in JSON at position 27 #66

Closed
oceanlvr opened this issue Sep 20, 2018 · 8 comments
Closed

SyntaxError: Unexpected string in JSON at position 27 #66

oceanlvr opened this issue Sep 20, 2018 · 8 comments

Comments

@oceanlvr
Copy link

I can't log in.
need your help.
v8.12.0
undefined:1
{"cache":true,"retry":true}"leetcode.cn":true}
^

SyntaxError: Unexpected string in JSON at position 27
at JSON.parse ()
at Object.cache.get (C:\Users\oyx.vscode\extensions\shengchen.vscode-leetcode-0.8.0\node_modules\leetcode-cli\lib\cache.js:17:15)
at Function.Plugin.init (C:\Users\oyx.vscode\extensions\shengchen.vscode-leetcode-0.8.0\node_modules\leetcode-cli\lib\plugin.js:131:22)
at Object.cli.run (C:\Users\oyx.vscode\extensions\shengchen.vscode-leetcode-0.8.0\node_modules\leetcode-cli\lib\cli.js:82:14)
at Object. (C:\Users\oyx.vscode\extensions\shengchen.vscode-leetcode-0.8.0\node_modules\leetcode-cli\bin\leetcode:3:23)
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)

__

@oceanlvr
Copy link
Author

@jdneo Could you please tell me what wrong with it? thx for your patience. 👍 👍 👍

@oceanlvr
Copy link
Author

and I try to log with leetcode-cil directly. By using the command:

Install leetcode cli: npm install -g leetcode-cli
leetcode user -l

It occurs the same error. And I have no idea what happened.

@jdneo
Copy link
Member

jdneo commented Sep 21, 2018

@oceanlvr Hmm, What's your target login endpoint? Is it leetcode or leetcode.cn?

@oceanlvr
Copy link
Author

Thx for your reply. And I want to log in leetcode
But when I change the endpoint.
An error comes out.

Failed to delete cache. Please open the output channel for details.

@oceanlvr
Copy link
Author

image
@jdneo

@jdneo
Copy link
Member

jdneo commented Sep 21, 2018

@oceanlvr Ok. Looks like the json format is wrong. Could you please try to find this file: C:\Users\[username]\.lc\plugins.json. And open it.

From your error logs, it looks like the json is wrong: {"cache":true,"retry":true}"leetcode.cn":true}.

Try to change it to {"cache":true,"retry":true,"leetcode.cn":true} and to see if this could help.

@oceanlvr
Copy link
Author

@jdneo Thank you! I Successfully login.:smile::smile::smile:

@jdneo
Copy link
Member

jdneo commented Sep 21, 2018

@oceanlvr Great. Not quite sure if this is a bug for leetcode-cli. 😄

@jdneo jdneo closed this as completed Sep 21, 2018
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

2 participants