进阶 docs.nodebb.org 2026-10-13 15:07:09 · 35 阅读

第59章 NodeBB常见问题解答

需要帮助?

常见问题

如果你在部署 NodeBB 实例时遇到困难,下面这些内容或许能帮到你。

如何启动、停止或重启 NodeBB?

你可以运行 ./nodebb 可执行文件来启动和停止 NodeBB:

$ ./nodebb Usage: ./nodebb [options] [command]

Welcome to NodeBB

Options: -V, --version output the version number --json-logging Output to logs in JSON format (default: false) --log-level Default logging level to use (default: "info") --config Specify a config file (default: "config.json") -d, --dev Development mode, including verbose logging (default: false) -l, --log Log subprocess output to console (default: false) -h, --help display help for command

Commands: start Start the NodeBB server stop Stop the NodeBB server restart Restart the NodeBB server status Check the running status of the NodeBB server log Open the output log (useful for debugging) setup [options] [config] Run the NodeBB setup script, or setup with an initial config install Launch the NodeBB web installer for configuration setup build [options] [targets...] Compile static assets (JS, CSS, templates, languages) activate [plugin] Activate a plugin for the next startup of NodeBB (nodebb-plugin- prefix is optional) plugins List all installed plugins events [count] Outputs the most recent administrative events recorded by NodeBB info Outputs various system info reset [options] Reset plugins, themes, settings, etc user [command] Manage users upgrade [options] [scripts...] Run NodeBB upgrade scripts and ensure packages are up-to-date, or run a particular upgrade script help [command] Display help for [command]

如何重置管理员密码?

./nodebb 可用于重置任何用户的密码。你只需要知道用户 ID 即可。要设置新密码,可以使用以下命令:

./nodebb user reset --password

提示:默认安装中,管理员的用户 ID 为 1。

如何将 NodeBB 升级到新版本?

请参阅“升级 NodeBB”文档。

我升级了 NodeBB,现在某个功能(X)不能正常工作了!

请参阅“升级 NodeBB”文档。

我安装了一个不兼容的插件,现在论坛无法启动了!

如果你知道是哪个插件导致了问题,请运行以下命令禁用它:

./nodebb reset -p nodebb-plugin-pluginName

否则,请运行以下命令禁用所有插件:

./nodebb reset -p

我遇到了“npm ERR!”错误

大多数涉及 npm 的错误都是因为 Node.js 版本过旧。如果在运行 npm install 时看到类似以下错误:

npm ERR! Unsupported npm ERR! Not compatible with your version of node/npm: [email protected]

你需要将 Node.js 版本更新到 4 或更高版本。

在 Ubuntu 上执行此操作:

# Using Ubuntu curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash - sudo apt-get install -y nodejs

# Using Debian, as root curl -sL https://deb.nodesource.com/setup_4.x | bash - apt-get install -y nodejs

如果成功,运行以下命令应显示高于 0.8 的版本号

apt-cache policy nodejs

我 NodeBB 上的 URL(或电子邮件)仍然包含端口号!

如果你使用 nginx 或 Apache 作为反向代理,则不需要显示端口号。只需运行 ./nodebb setup,并指定不含端口号的基础 URL。

或者,使用你喜欢的文本编辑器打开 config.json 文件,将 use_port 更改为 false。

“最近登录 IP”部分只显示 127.0.0.1

运行在代理后面的 NodeBB 可能难以确定请求的来源原始 IP 地址。代理服务器提供 referer IP 头信息非常重要。

在 nginx 中,请确保服务器块中存在以下行:

proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

此外,请确保在 NodeBB 的 config.json 中,use_port 选项设置为 false。

在我们的 Issue Tracker 上提交 Bug

在报告 bug 之前,请确认该问题尚未在我们的 tracker 中提出,或者尚未在我们的支持论坛中解决。如果尚未提出,请随意在 GitHub 上注册账号并创建新的 issue。

向 NodeBB 社区提问

安装 NodeBB 遇到困难了吗?或者有什么东西损坏了?别犹豫,加入我们的论坛寻求帮助。

希望有一天你也能帮助别人 :)

评论 (0)