0

I have a work project where I need to enforce an older version (10.24.1) of on .

I'm managing my node version via . Specifically, I've set my default version of to said 10.24.1 via

$ nvm alias default 10

enter image description here

This also checks out with running version and set env version.

$ node -v
$ npx eslint --env-info

enter image description here

However, locally my ESLint seems to crash when viewing files in .

enter image description here

I also tried specifying in local configuration in package.json:

"engines": {
  "node": ">=10.24.1"
}

This however seems to take no effect. So I'm not really sure what else I should do.

Is there any idea on how to enforce the server to run on my specified node version instead of the v14.6.0?

Samuel Hulla
  • 5,914
  • 6
  • 30
  • 57
  • 1
    i think this covers your case? https://stackoverflow.com/questions/44700432/visual-studio-code-to-use-node-version-specified-by-nvm/48710384 – G-Force Sep 14 '21 at 15:18
  • Speficially the default alias woked for me: https://stackoverflow.com/a/44707192/5512705 – Samuel Hulla Sep 20 '21 at 09:11

1 Answers1

0

Add .nvmrc and .node-version files to your project directory

.nvmrc file content:

10.24.1

.node-version file content:

10.24.1

And after,

npm i -g @typescript-eslint should fix your issue.

Ghouse Mohamed
  • 117
  • 2
  • 9