Skip to content

Error: LeetCode extension needs Node.js installed in environment path #201

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

Closed
skyhiter opened this issue Mar 12, 2019 · 13 comments
Closed

Comments

@skyhiter
Copy link

🐛 Bug Report

When sign in, it pops up "LeetCode extension needs Node.js installed in environment path".
But node command has been in my environment path.
image

To Reproduce

select "LeetCode Sign In" command.

Expected behavior

pop up login window.

Your Environment

  • os: macbook pro, macOS 10.14.3
  • extension settings:
    RalfZhang.filetemplate
    SirTori.indenticator
    aaron-bond.better-comments
    abusaidm.html-snippets
    alefragnani.project-manager
    anseki.vscode-color
    austin.code-gnu-global
    christian-kohler.path-intellisense
    CoenraadS.bracket-pair-colorizer
    dbaeumer.vscode-eslint
    donjayamanne.githistory
    eamodio.gitlens
    ecmel.vscode-html-css
    eg2.tslint
    emilast.LogFileHighlighter
    felipecaputo.git-project-manager
    formulahendry.auto-close-tag
    formulahendry.code-runner
    goessner.mdmath
    GrapeCity.gc-excelviewer
    HookyQR.beautify
    humao.rest-client
    humy2833.ftp-simple
    James-Yu.latex-workshop
    johnstoncode.svn-scm
    kondratiev.sshextension
    lextudio.restructuredtext
    liximomo.sftp
    lonefy.vscode-JS-CSS-HTML-formatter
    MS-CEINTL.vscode-language-pack-zh-hans
    ms-mssql.mssql
    ms-python.anaconda-extension-pack
    ms-python.python
    ms-vscode.cpptools
    ms-vscode.Go
    neuron.neuron-IPE
    octref.vetur
    redhat.java
    redhat.vscode-yaml
    ritwickdey.LiveServer
    robertohuertasm.vscode-icons
    rust-lang.rust
    ryu1kn.partial-diff
    SBSnippets.pytorch-snippets
    Shan.code-settings-sync
    shengchen.vscode-leetcode
    streetsidesoftware.code-spell-checker
    VisualStudioExptTeam.vscodeintellicode
    vscjava.vscode-java-debug
    vscjava.vscode-java-dependency
    vscjava.vscode-java-pack
    vscjava.vscode-java-test
    vscjava.vscode-maven
    waderyan.gitblame
    yzane.markdown-pdf
    yzhang.markdown-all-in-one
    zhuangtongfa.Material-theme
    Zignd.html-css-class-completion
  • nodejs version: v10.15.2
  • vscode version: 1.32.1
  • extension version: 0.12.0
@jdneo
Copy link
Member

jdneo commented Mar 12, 2019

@skyhiter How did you start your VS Code?

@skyhiter
Copy link
Author

Thank you for your prompt reply.

I just clicked the vscode icon from mac's Dock.

In my impression,vscode 1.30(when I first use leetcode extension) was going well. But this error has arisen when vscode updated to 1.31.(the same to 1.32 ).

image
image

@jdneo
Copy link
Member

jdneo commented Mar 13, 2019

@skyhiter Wired. It should not be a problem with the VS Code.

Have you upgraded the node recently? Have you tried to restart the OS?

@skyhiter
Copy link
Author

skyhiter commented Mar 13, 2019

I can't remember.But, I install node8, it not works.

  1. brew uninstall node (v10)
  2. brew install node@8
  3. vim .zshrc,delete export PATH="/usr/local/opt/node@10/bin:$PATH",
    add export PATH="/usr/local/opt/node@8/bin:$PATH"
  4. source .zshrc
  5. now, system zsh shell will show v8.15.1
  6. resinstall vscode leetcode extension.
  7. restart vscode, and LeetCode Sign In, but it pops up this error also.
  8. after restarting macbook, it also not works.
    image

@jdneo
Copy link
Member

jdneo commented Mar 13, 2019

Guess this is because you are put the node executable into your zshell's path, but not the default bash's path.

While the extension won't able to get this information when it creates a child process to execute leetcode tasks.

@skyhiter
Copy link
Author

Maybe. I aways use zsh, it had worked before.

I'll find out the cause of the error by myself. Thank you for your prompt reply.

@skyhiter skyhiter reopened this Mar 13, 2019
@skyhiter
Copy link
Author

skyhiter commented Mar 13, 2019

please see issueCustomized environment variables not available for extensions when VS Code is not launched via terminal.

When I start vscode from zsh, it works!

So, it may be vscode's bug (or feature?).

@jdneo
Copy link
Member

jdneo commented Mar 13, 2019

In my personal opinion, I think it's not a bug. This is as expected for using another shell.

Closing it for now since the issue has been resolved.

@tianzhich
Copy link

Any other way to resolve this except for launching vsc from terminal?

@daisy11100
Copy link

I have the same problem,because input the error node path.so try to get the correct node.exe path

@DineshRajanT
Copy link

Have the same issue!!

@YeQiuO
Copy link

YeQiuO commented Apr 26, 2023

这个问题恶心了我一个下午,总算是在睡前解决了

具体解决方案:
在系统变量中找到PATH,点击编辑,点击新建,添加 C:\Windows\System32 这个变量,随即确定

分析原因:
win使用了 where node 命令调用 node.exe,调用失败就会出现这个问题

如果有帮助到你,请祝我前程似锦~
当然,也祝你万事顺意!

@LeonardoRick
Copy link

I have the same issue. In my opinion this is not expected even using another shells.

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

7 participants