You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 0485f58
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: docs/configuration.md
+36-1Lines changed: 36 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ Here’s a list of these features and capabilities:
10
10
11
11
**✅ Highly recommended**
12
12
13
-
`--use-on-cd` appends output to `fnm env`'s output that will hook into your shell upon changing directories, and will switch the Node.js version based on the requirements of the current directory, based on `.node-version` or `.nvmrc` (or `packages.json#engines#node` if `--resolve-engines` was enabled).
13
+
`--use-on-cd` appends output to `fnm env`'s output that will hook into your shell upon changing directories, and will switch the Node.js version based on the requirements of the current directory, based on `.node-version` or `.nvmrc` (or `packages.json#devEngines#runtime` if `--resolve-dev-engines` was enabled and `packages.json#engines#node` if `--resolve-engines` was enabled).
14
14
15
15
This allows you do avoid thinking about `fnm use`, and only `cd <DIR>` to make it work.
16
16
@@ -52,6 +52,41 @@ error: Can't find version in dotfiles. Please provide a version manually to the
52
52
53
53
Runs [`corepack enable`](https://nodejs.org/api/corepack.html#enabling-the-feature) when a new version of Node.js is installed. Experimental due to the fact Corepack itself is experimental.
54
54
55
+
### `--resolve-dev-engines`
56
+
57
+
Treats Node version in `packages.json#devEngines#runtime` as a valid Node.js version file ("dotfile"). So, if you have a package.json with the following content:
58
+
59
+
```json
60
+
{
61
+
"devEngines": {
62
+
"runtime": {
63
+
"name": "node",
64
+
"version": ">=20 <21"
65
+
}
66
+
}
67
+
}
68
+
```
69
+
70
+
or:
71
+
72
+
```json
73
+
{
74
+
"devEngines": {
75
+
"runtime": [
76
+
{
77
+
"name": "node",
78
+
"version": ">=20 <21"
79
+
}
80
+
]
81
+
}
82
+
}
83
+
```
84
+
85
+
Then:
86
+
87
+
-`fnm install` will install the latest satisfying Node.js 20.x version available in the Node.js dist server
88
+
-`fnm use` will use the latest satisfying Node.js 20.x version available on your system, or prompt to install if no version matched.
0 commit comments