首页 > 解决方案 > 为什么 LeetCode 扩展无法在 ubuntu 16.04 的 Visual Studio Code 中运行?

问题描述

我已经成功安装了 LeetCode 扩展和node.js,然后在 LeetCode 扩展中点击 Switch Endpoint 或 Sign in 的图标,报错:</p>

找不到命令“leetcode.toggleLeetCodeCn”

或者

找不到命令“leetcode.signin”。

我曾尝试更改nodejs和 LeetCode 扩展的版本,但没有奏效。当我重新加载VSCode窗口时,它会报告这个错误:

LeetCode 扩展需要在环境路径中安装 Node.js

然后我按照提示打开输出通道,OUTPUT菜单显示:

/bin/sh: 1: /usr/local/bin: Permission denied 错误:环境不符合要求。有没有人遇到过这个问题?请帮我!谢谢。

我的软件版本:

Ubuntu:16.04 x64

VS代码:1.52.1 x64

我尝试过的nodejs版本:8.9.3/15.6.0/15.10.0

我尝试过的 leetcode 扩展版本:0.16.2/0.17.0

标签: node.jsubuntuvisual-studio-code

解决方案


This error also occurs to me. The leetcode plugin worked well in the past weeks, but today, all of sudden, it stopped working

I tried

  1. re-intall leetcode cli globally
  2. add source .bash_profile and .bashrc to my zshrc
  3. update node

However, none of them works.

The problem was resolved by doing the follow

  1. disable leetcode plugin
  2. reload
  3. enable leetcode plugin

推荐阅读