我可以在以下项目中使用不同版本的 Node:IBM Bluemix DevOps Services,构建步骤 'npm' 构建器类型吗?

Can I use a different version of Node in the: IBM Bluemix DevOps Services, build step 'npm' builder type?

我正在构建一个 ember 应用程序,然后将其打包到一个 WAR 文件中以部署到 liberty 运行时。

ember 构建过程警告我 ember-cli 将停止使用节点 v0.10.29 并建议使用节点 0.12。

我可以在 DevOps Services 中使用不同版本的 Node,构建步骤 'npm' 构建器类型吗?

Future versions of Ember CLI will not support v0.10.29. Please update to Node 0.12 or io.js. version: 0.2.7 1.13.8

Could not find watchman, falling back to NodeWatcher for file system events. Visit http://www.ember-cli.com/#watchman for more info. BuildingBuilding.Building..Building...BuildingBuilding.Building..Building...BuildingBuilding.Building..Building...BuildingBuilding.Building..Building...BuildingBuilding.(node) warning: Recursive process.nextTick detected. This will break in the next version of node. Please use setImmediate for recursive deferral. (node) warning: Recursive process.nextTick detected. This will break in the next version of node. Please use setImmediate for recursive deferral. ... (repeated node warnings) ... (node) warning: Recursive process.nextTick detected. This will break in the next version of node. Please use setImmediate for recursive deferral.

RangeError: Maximum call stack size exceeded Build step 'Execute shell' marked build as failure Finished: FAILURE

您在 package.json 中指定的节点版本是什么? Bluemix 支持所有当前可用的节点版本,请查看 "Node.js runtime versions" 下的 the docs 了解更多信息。继续并在 package.json 中将所需的版本指定为 engines 属性,你应该没问题。

v0.10.29 是构建映像中存在的唯一节点版本。为了使用不同的版本,用户必须下载它。这是一个如何做到这一点的示例脚本

#!/bin/bash
node_version=v0.12.7
install_name=node-v0.12.7-linux-x64
if [ ! -e $install_name.tar.gz ]; then
wget "http://nodejs.org/dist/$node_version/$install_name.tar.gz"
echo 'Untarring'
tar xf $install_name.tar.gz
fi
NODE_12_INSTALL_DIR=`pwd`/$install_name/bin
PATH=$NODE_12_INSTALL_DIR:$PATH
node -v