From 11412b2e720f754900b39d195f33af39ed11d085 Mon Sep 17 00:00:00 2001 From: NeonXP Date: Sun, 28 Jan 2024 20:43:11 +0300 Subject: Go теперь фича над базовым образом MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- features/src/node/NOTES.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 features/src/node/NOTES.md (limited to 'features/src/node/NOTES.md') diff --git a/features/src/node/NOTES.md b/features/src/node/NOTES.md new file mode 100644 index 0000000..65eb93b --- /dev/null +++ b/features/src/node/NOTES.md @@ -0,0 +1,25 @@ +## Using nvm from postCreateCommand or another lifecycle command + +Certain operations like `postCreateCommand` run non-interactive, non-login shells. Unfortunately, `nvm` is really particular that it needs to be "sourced" before it is used, which can only happen automatically with interactive and/or login shells. Fortunately, this is easy to work around: + +Just can source the `nvm` startup script before using it: + +```json +"postCreateCommand": ". ${NVM_DIR}/nvm.sh && nvm install --lts" +``` + +Note that typically the default shell in these cases is `sh` not `bash`, so use `. ${NVM_DIR}/nvm.sh` instead of `source ${NVM_DIR}/nvm.sh`. + +Alternatively, you can start up an interactive shell which will in turn source `nvm`: + +```json +"postCreateCommand": "bash -i -c 'nvm install --lts'" +``` + + + +## OS Support + +This Feature should work on recent versions of Debian/Ubuntu-based distributions with the `apt` package manager installed. + +`bash` is required to execute the `install.sh` script. -- cgit v1.2.3