Run VsCode while using specific node version

55 Views Asked by At

In the windows operation system, I have an application with precompile hooks, the precompile hooks need node v18.17.0, while my default node version is 14.15.1. I can't change my default node version because there are more than one project that uses node v14, so I installed NVS due to build my project using different versions of node.

There is a problem, when I open VsCode it will use default node version in its terminal and also in Source Control part. So when I want to push my codes and and VsCode wants to apply precompile hooks because they node version is lower that what expected they faced errors.

One solution is open cmd and then run nvs 18.17.0 , then simply run code . so VsCode will run over this node version. Also we can simply create a Batch or PowerShell file that contains the following code to run these automatically, but this also is not good because we should include this file in project or share it with team-mates.

cd D:\codes\projectFoleder
nvs 18.17.0
code .

I am looking for something to apply in my project config so other team mate when running the VsCode in this project folder the node version automatically change to 18.7.0. Also note that because of some organization security we can't have NVM due to some security policies.

0

There are 0 best solutions below