diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 0000000000..3f430af82b --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +v18 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index bee5561659..a62de22c60 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -36,6 +36,12 @@ You can then install the other dependencies using the Makefile using the bootstr make bootstrap ``` +To develop on your own computer, make sure you have a compatible version of node installed in your environment. The simplest way to make sure you're using a compatible +version of node is to install [nvm](https://github.com/nvm-sh/nvm#installing-and-updating) and run the following command each time you open a terminal in the packs-sdk repo: + +```sh +source setup-env.sh +``` ### Preview documentation diff --git a/setup-env.sh b/setup-env.sh index f38814fc79..7734cd7137 100644 --- a/setup-env.sh +++ b/setup-env.sh @@ -9,3 +9,9 @@ if [[ "$(uname -s)" == "Darwin" ]] && [[ "$(arch)" == "arm64" ]]; then fi export PATH=${BASEDIR}/build/node/bin:${BASEDIR}/node_modules/.bin:${BASEDIR}/.pnpm_install/bin:${PATH} + +if command -v nvm &> /dev/null +then + # Gets version from .nvmrc + nvm use +fi