Browse Source

[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 <markus.heiser@darmarit.de>
Markus Heiser 3 years ago
parent
commit
3e2f3900b8
1 changed files with 3 additions and 2 deletions
  1. 3 2
      utils/lib_nvm.sh

+ 3 - 2
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}")"
     NVM_VERSION_TAG="$(git describe --abbrev=0 --tags --match "v[0-9]*" "${NVM_VERSION_TAG}")"
     info_msg "checkout ${NVM_VERSION_TAG}"
     info_msg "checkout ${NVM_VERSION_TAG}"
     git checkout "${NVM_VERSION_TAG}" 2>&1 | prefix_stdout "  ${_Yellow}||${_creset} "
     git checkout "${NVM_VERSION_TAG}" 2>&1 | prefix_stdout "  ${_Yellow}||${_creset} "
+    popd &> /dev/null
     nvm.env
     nvm.env
 }
 }
 
 
@@ -133,7 +134,7 @@ nvm.clean() {
     fi
     fi
 }
 }
 
 
-nvm.status(){
+nvm.status() {
     if command -v node >/dev/null; then
     if command -v node >/dev/null; then
         info_msg "Node.js is installed at $(command -v node)"
         info_msg "Node.js is installed at $(command -v node)"
         info_msg "Node.js is version $(node --version)"
         info_msg "Node.js is version $(node --version)"
@@ -157,7 +158,7 @@ nvm.status(){
     fi
     fi
 }
 }
 
 
-nvm.nodejs(){
+nvm.nodejs() {
     nvm install --lts
     nvm install --lts
     nvm.status
     nvm.status
 }
 }