Skip to content
This repository has been archived by the owner on Nov 2, 2024. It is now read-only.

[nginxproxymanager] Error installing Node.js with default settings #2200

Closed
jtweaver opened this issue Dec 16, 2023 · 7 comments
Closed

[nginxproxymanager] Error installing Node.js with default settings #2200

jtweaver opened this issue Dec 16, 2023 · 7 comments
Labels
🧐 Not a Script Issue Not a Script Issue

Comments

@jtweaver
Copy link

Please verify that you have read and understood the guidelines.

yes

A clear and concise description of the issue.

nginxproxymanager fails to install using default settings. Looks like a failure with nvm. I tried the command in the nginxproxymanager LXC shell after the failure and it does complete. I've omitted the rest of the install log for brevity. Let me know if you'd like it included.

Which Linux distribution are you employing?

Default Settings

If relevant, including screenshots or a code block can be helpful in clarifying the issue.

+ echo -e '\r\033[K \033[1;92m✓\033[m \033[1;92mInstalled Openresty\033[m'
 ✓ Installed Openresty
+ msg_info 'Installing Node.js'
+ local 'msg=Installing Node.js'
+ echo -ne ' - \033[33mInstalling Node.js...'
 - Installing Node.js...+ bash /dev/fd/63
++ curl -fsSL https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh
=> Downloading nvm from git to '/root/.nvm'
=> Cloning into '/root/.nvm'...
remote: Enumerating objects: 365, done.
remote: Counting objects: 100% (365/365), done.
remote: Compressing objects: 100% (314/314), done.
remote: Total 365 (delta 43), reused 159 (delta 25), pack-reused 0
Receiving objects: 100% (365/365), 364.78 KiB | 3.01 MiB/s, done.
Resolving deltas: 100% (43/43), done.
* (HEAD detached at FETCH_HEAD)
  master
=> Compressing and cleaning up git repository

=> Appending nvm source string to /root/.profile
=> bash_completion source string already in /root/.profile
=> Close and reopen your terminal to start using nvm or run the following to use it now:

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm
+ . /root/.bashrc
+ nvm install 16.20.1
bash: line 59: nvm: command not found
++ error_handler 59 '$STD nvm install 16.20.1'
++ local exit_code=127
++ local line_number=59
++ local 'command=$STD nvm install 16.20.1'
++ local 'error_message=\033[01;31m[ERROR]\033[m in line \033[01;31m59\033[m: exit code \033[01;31m127\033[m: while executing command \033[33m$STD nvm install 16.20.1\033[m'
++ echo -e '\n\033[01;31m[ERROR]\033[m in line \033[01;31m59\033[m: exit code \033[01;31m127\033[m: while executing command \033[33m$STD nvm install 16.20.1\033[m'

[ERROR] in line 59: exit code 127: while executing command $STD nvm install 16.20.1
++ [[ 59 -eq 24 ]]
+ exit

Please provide detailed steps to reproduce the issue.

Install nginxproxymanager using default settings

@tteck
Copy link
Owner

tteck commented Dec 16, 2023

#2188

Here is the issue some are having

Nginx Proxy Manager (NPM) requires node version 16, with Debian 12, It can't be installed the normal way

curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_16.x nodistro main" >/etc/apt/sources.list.d/nodesource.list
apt-get update
apt-get install -y nodejs

because for some reason it still installs version 18, so you have to use Node Version Manager (NVM) to install node.js v16

bash <(curl -fsSL https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh)
. ~/.bashrc
nvm install 16.20.1
ln -sf /root/.nvm/versions/node/v16.20.1/bin/node /usr/bin/node

The command . ~/.bashrc reloads the Bash shell configuration file to apply any changes made during the NVM installation. It's necessary to do this so that the NVM command is available in the current shell session. For reasons unknown to me, a few are having issues reloading the Bash shell configuration.

I'm going to change . ~/.bashrc to source ~/.bashrc in hopes of broader compatibility across different shells.

@tteck
Copy link
Owner

tteck commented Dec 16, 2023

The change (72b8deb) has been made, If you'd like to try again, make sure that you've cleared your browser cache.

@jtweaver
Copy link
Author

That worked. Much appreciated.

Your comment reminded me that I had switched my shell to zsh a while back. So I ran the new script with /usr/bin/bash and it succeeded. And it appeared to fail before with zsh, so I'm not 100% sure which fixed it. Anyway, thanks for the quick fix.

@tteck tteck added the 🧐 Not a Script Issue Not a Script Issue label Dec 16, 2023
@tteck
Copy link
Owner

tteck commented Dec 16, 2023

An informative test would be to switch back to using zsh and see if it succeeds.

@jtweaver
Copy link
Author

An informative test would be to switch back to using zsh and see if it succeeds.

Looks like it does indeed fail using zsh with what appears to be the same error, included here in case there are any details I missed.

 ✓ Installed Openresty
+ msg_info 'Installing Node.js'
+ local 'msg=Installing Node.js'
+ echo -ne ' - \033[33mInstalling Node.js...'
 - Installing Node.js...+ bash /dev/fd/63
++ curl -fsSL https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh
=> Downloading nvm from git to '/root/.nvm'
=> Cloning into '/root/.nvm'...
remote: Enumerating objects: 365, done.
remote: Counting objects: 100% (365/365), done.
remote: Compressing objects: 100% (314/314), done.
remote: Total 365 (delta 43), reused 159 (delta 25), pack-reused 0
Receiving objects: 100% (365/365), 364.78 KiB | 2.78 MiB/s, done.
Resolving deltas: 100% (43/43), done.
* (HEAD detached at FETCH_HEAD)
  master
=> Compressing and cleaning up git repository

=> Appending nvm source string to /root/.profile
=> bash_completion source string already in /root/.profile
=> Close and reopen your terminal to start using nvm or run the following to use it now:

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm
+ source /root/.bashrc
+ nvm install 16.20.1
bash: line 59: nvm: command not found
++ error_handler 59 '$STD nvm install 16.20.1'
++ local exit_code=127
++ local line_number=59
++ local 'command=$STD nvm install 16.20.1'
++ local 'error_message=\033[01;31m[ERROR]\033[m in line \033[01;31m59\033[m: exit code \033[01;31m127\033[m: while executing command \033[33m$STD nvm install 16.20.1\033[m'
++ echo -e '\n\033[01;31m[ERROR]\033[m in line \033[01;31m59\033[m: exit code \033[01;31m127\033[m: while executing command \033[33m$STD nvm install 16.20.1\033[m'

[ERROR] in line 59: exit code 127: while executing command $STD nvm install 16.20.1
++ [[ 59 -eq 24 ]]
+ exit

@tteck
Copy link
Owner

tteck commented Dec 16, 2023

Thanks for doing that test. Now we have the answer.

@pegelf
Copy link

pegelf commented Jan 3, 2024

I can confirm, that zsh was the issue. I also ran the command using zsh as shell, which failed at the node.js part. After changing the shell back to bash, everything worked. I will now keep bash as default for the proxmox shell.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🧐 Not a Script Issue Not a Script Issue
Projects
None yet
Development

No branches or pull requests

3 participants