Use .nvmrc #4142
bitdivine
started this conversation in
Feature Requests
Use .nvmrc
#4142
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Motivation
Each of our ICP projects specifies a specific node version. This is important to get reliable results and reproducible builds. But when switching between projects it is necessary to remember to switch node version for native (non-dockerized) builds. This is an unnecessary risk.
The situation with Rust is better; if there is a
rust-toolchain.toml
file, the rust version in that file is used automatically (when runningdfx build
and similar commands).It would be nice if front-end canister builds did the same.
Proposed solution
.nvmrc
file,dfx build
of a front-end canister could use it. For example, this uses the node version in the.nvmrc
:.node-version
file, do something similar. I find this situation a bit ambiguous though. The.node-version
file is used by many tools. Maybe someone actively does NOT want to usenvm
. By the existence of a.node-version
file we cannot determine the user's preferred node versioning tool. Maybe it would be best to do nothing in this case. A user can always opt in by soft-linking.nvmrc
to the.node-version
file.npm
directly.Beta Was this translation helpful? Give feedback.
All reactions