简体   繁体   中英

VSCode with WSL - How to use Bash for the launch configurations?

I use Visual Studio Code to develop a TypeScript Node application on Windows 10, with WSL enabled.

Thanks to other threads , I'm almost able to run a VSCode task with Bash on Ubuntu on Windows.

But now I try to do the same with a launch configuration . How can I make a launch configuration to use the node executable installed in WSL instead of the one installed on Windows?

If I run this command directly in the integrated terminal, with Bash, it works :

node src/start.js

But when I press " [F5] " and start a launch configuration that runs this same file, I get an error : " Error: %1 is not a valid Win32 application ". This is because the oracledb library is used and has been compiled in Bash, not in Windows.

How can I make a launch configuration use Bash to run Node?

UPDATE : I opened an issue about that on VSCode's GitHub page.

Not if sure you still need help.

  • open bash outside of the vs code.
  • then run the following command, to install node.

    sudo apt install nodejs-legacy

and you should be able to run node with bash in vs code.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM