From 3e2f3900b83e67afc083180380c66a349f1e2e6b Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Sat, 20 Nov 2021 12:55:15 +0100 Subject: [PATCH] [fix] nvm.install: add missing popd / node.env exit with error (254) Issue:: $ make clean node.env ... CLEAN [NVM] drop .nvm/ ... INFO: install Node.js by NVM ... Now using node v16.13.0 (npm v8.1.0) ... INSTALL searx/static/themes/oscar/package.json npm ERR! code ENOENT npm ERR! syscall open # Here now comes the issue, caused by the missing 'popd' .. npm ERR! path SearXNG/.nvm/searx/static/themes/oscar/package.json npm ERR! errno -2 npm ERR! enoent ENOENT: no such file or directory, open 'SearXNG/.nvm/searx/static/themes/oscar/package.json' ERROR: node.env exit with error (254) make: *** [Makefile:99: node.env] Error 254 Signed-off-by: Markus Heiser --- utils/lib_nvm.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/utils/lib_nvm.sh b/utils/lib_nvm.sh index d35abef2..77e9eabf 100755 --- a/utils/lib_nvm.sh +++ b/utils/lib_nvm.sh @@ -115,6 +115,7 @@ nvm.install() { NVM_VERSION_TAG="$(git describe --abbrev=0 --tags --match "v[0-9]*" "${NVM_VERSION_TAG}")" info_msg "checkout ${NVM_VERSION_TAG}" git checkout "${NVM_VERSION_TAG}" 2>&1 | prefix_stdout " ${_Yellow}||${_creset} " + popd &> /dev/null nvm.env } @@ -133,7 +134,7 @@ nvm.clean() { fi } -nvm.status(){ +nvm.status() { if command -v node >/dev/null; then info_msg "Node.js is installed at $(command -v node)" info_msg "Node.js is version $(node --version)" @@ -157,7 +158,7 @@ nvm.status(){ fi } -nvm.nodejs(){ +nvm.nodejs() { nvm install --lts nvm.status }