https://github.com/rofrol/vscode-tools
Settings for vscode to use fnm to set nodejs version from .nvmrc or .node-version
https://github.com/rofrol/vscode-tools
vscode
Last synced: about 1 year ago
JSON representation
Settings for vscode to use fnm to set nodejs version from .nvmrc or .node-version
- Host: GitHub
- URL: https://github.com/rofrol/vscode-tools
- Owner: rofrol
- License: apache-2.0
- Created: 2021-10-26T18:30:53.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2021-11-15T12:00:19.000Z (over 4 years ago)
- Last Synced: 2025-07-03T13:59:03.725Z (about 1 year ago)
- Topics: vscode
- Language: Shell
- Homepage:
- Size: 5.86 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## vscode tools
Make vscode use correct nodejs version according from `.nvmrc` or `.node-version` using .
Underneath this tools run [fnm](https://github.com/Schniz/fnm) to set `nodejs` from `.nvmrc`.
It applies to running `npm`, `yarn` or `gulp` from `tasks.json` or integrated terminal in linux.
You may freely change it to use `nvm` instead of `fnm` or modifyt for integrated terminals on others OS-es.
PR-s welcomes.
## Why not engines and engine=strict?
Yarn ignores [`engine=strict`](https://docs.npmjs.com/cli/v7/using-npm/config#engine-strict).
Yarn ignores `preinstall` from package.json scripts.
And vscode [does not](https://github.com/microsoft/vscode/issues/102746#issuecomment-659940381) let you set `runtimeExecutable` in `tasks.json` like it does for `launch.json`.
## How to use it?
`fnm` will read `.nvmrc` to set wanted `nodejs` version.
Copy `.nvmrc` to your `projects`.
Copy `settings.json` to your `/.vscode` directory. Modify paths accordingly in `settings.json`.
Task has to be of `shell` type. You can copy example `tasks.json` to your `/.vscode`.