2015-10-22 29 views
1

我正在構建一個應用程序應用程序,然後將它打包成WAR文件以部署到Liberty運行時。我可以在IBM Bluemix DevOps Services中使用不同版本的節點,構建「npm」構建器類型?

該構建過程會警告我,ember-cli將停止使用節點v0.10.29,並建議使用節點0.12。

我可以在:DevOps Services,構建步驟'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

回答

2

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 
1

你在你的package.json指定哪些節點版本? Bluemix支持所有當前可用的節點版本,請參閱「Node.js運行時版本」下的the docs以獲取更多信息。繼續並在package.json中指定所需的版本爲engines屬性,您應該沒問題。

+0

我已經在'packages.json'中指定了我想要的版本作爲'engines'屬性:'>> = 0.12.0「'。 構建應用程序時的Node.js版本與可用於運行應用程序的Node.js運行時不同。我想在IBM DevOps Services(以前的jazzhub.net)中構建應用程序時更改Node.js版本。 – user1605729

+0

對,您可以使用Cloud Foundry CLI的'-b'選項或'buildpack'選項在'manifest.yml'中指定buildpack。 IBM SDK for node(sdk-for-nodejs_v2_5-20150902-1526)和CloudFoundry [community buildpack](https://github.com/cloudfoundry/nodejs-buildpack)都可以使用。 –

+1

指定buildpack有助於選擇在運行時使用的節點版本:[Buildpacks爲您的應用程序提供框架和運行時支持](http://docs.cloudfoundry.org/buildpacks/)。 我想更改IBM DevOps管道提供的版本。 – user1605729

相關問題