-
Notifications
You must be signed in to change notification settings - Fork 668
failed to activate leetcode plugins after install(Extension initialization failed) #535
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
Comments
I also encountered a similar initialization problem. I have no clue how to solve this problem. Extension Output
Environment
Reproduce
curl -sL https://deb.nodesource.com/setup_14.x -o nodesource_setup.sh
sudo bash nodesource_setup.sh
sudo apt install nodejs
curl -fOL https://github.com/cdr/code-server/releases/download/v3.4.1/code-server_3.4.1_amd64.deb
sudo dpkg -i code-server_3.4.1_amd64.deb
systemctl --user enable --now code-server
# From the Coder extension marketplace (Same as manual installation
code-server --install-extension shengchen.vscode-leetcode
Some tryClear the cache and reinstallThere is no Install VS Code by docker codercom/code-server:latestThis docker seems to be using a Debian system. I entered the container and executed the same command as above to install nodejs v14.4.0 then mannually install leetcode plugin. It works! But I am a docker rookie, I can not easily manage the server directly through code-server webpage, such as nginx mysql php on the server. Change Nodejs Version to 13.x or 12.xI can get return with command Change OS to Cent OS 8.2
After a simple initial update and installations of nodejs and vscode, the same error occurred. Change OS to Cent OS 7.3 & Nodejs Version to 13.14.0This test was on a server in China created a long time ago, when I installed nodejs v13.14.0. After installing the plugin manually, the plugin works fine. Now I still haven't found a solution while using Ubuntu 20.04 & Nodejs 14.4.0... |
@skydai From your output, the json is ruined with wrong format. So, please remove the cache |
@monsterxcn Does your problem also have in standard VS Code? Since it seems that you are using code server(a third-party distribution) |
Nope. I don't have this problem on my laptop. (Windows 10 But on the server, sometimes it works normally, sometimes it doesn't. If it is a problem with code-server, it should go wrong in other situations. But I can run normally in the container codercom/code-server:latest and code-server on Cent OS 7.3 & Nodejs 13.14.0 . That's strange. 😅 |
I think I should have solved my problem. It's indeed a problem with code-server. Just install Node.js in the command line of the code-server instead of directly installing it in the SSH connection as the root user. My problem should be caused by user permissions . |
@monsterxcn Good to know the problem has been solved. |
🐛 Bug Report
cannot activate leetcode plugins after install
Expected behavior
succeed to activate leetcode plugins after install and login in
Extension Output
v12.16.1
undefined:1
{"solution.discuss":false,"company":false,"cache":true,"retry":true}"leetcode.cn":false}
^
SyntaxError: Unexpected string in JSON at position 68
at JSON.parse ()
at Object.cache.get (/Users/corndai/.vscode/extensions/shengchen.vscode-leetcode-0.16.1/node_modules/vsc-leetcode-cli/lib/cache.js:16:15)
at Function.Plugin.init (/Users/corndai/.vscode/extensions/shengchen.vscode-leetcode-0.16.1/node_modules/vsc-leetcode-cli/lib/plugin.js:86:23)
at initPlugins (/Users/corndai/.vscode/extensions/shengchen.vscode-leetcode-0.16.1/node_modules/vsc-leetcode-cli/lib/cli.js:62:14)
at Object.cli.run (/Users/corndai/.vscode/extensions/shengchen.vscode-leetcode-0.16.1/node_modules/vsc-leetcode-cli/lib/cli.js:100:3)
at Object. (/Users/corndai/.vscode/extensions/shengchen.vscode-leetcode-0.16.1/node_modules/vsc-leetcode-cli/bin/leetcode:3:23)
at Module._compile (internal/modules/cjs/loader.js:1158:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10)
at Module.load (internal/modules/cjs/loader.js:1002:32)
at Function.Module._load (internal/modules/cjs/loader.js:901:14)
undefined:1
{"solution.discuss":false,"company":false,"cache":true,"retry":true}"leetcode.cn":false}
To Reproduce
Your Environment
"leetcode.defaultLanguage": "java",
"leetcode.endpoint": "leetcode-cn",
"leetcode.hint.commandShortcut": false,
"leetcode.hint.configWebviewMarkdown": false,
"leetcode.hint.commentDescription": false,
The text was updated successfully, but these errors were encountered: