在 SemaphoreCI 上升级 NodeJS

Upgrading NodeJS on SemaphoreCI

我正在使用 NodeJS and running the project through SemaphoreCI。 该项目在我的机器上运行良好,但在 Semaphore 上失败。我怀疑这是因为节点版本不同(我的是v5.5,Semaphore使用的是v0.12)。

Google 让我 so many results 了解如何升级我的节点,但几乎所有这些都需要 sudo 访问权限。我想知道是否有人在 Semaphore 上有类似的问题。

Semaphore 为您提供完全的 sudo 访问权限,因此您可以 运行 任何 linux 命令,就像您在开发环境中所做的那样,这里是 the Semaphore docs 中的示例。

您可以 find here 在 Semaphore 上预安装的 NodeJS 版本的完整列表。如您所见,平台上没有 5.5 版本,因此您需要在构建过程中使用以下命令安装并切换到它:

nvm install 5.5
nvm use 5.5

如果你想使用一些已经预装的版本,你可以使用以下命令:

nvm use 5.6