简体   繁体   English

如何在我的应用程序中指定多个Node.js运行时版本以部署到Bluemix?

[英]How can I specify multiple Node.js runtime versions in my application to deploy to Bluemix?

In the package.json of my application, we can specify the node version: 在我的应用程序的package.json中,我们可以指定节点版本:

  1. What is the default Node.js runtime version if I do not specify anything? 如果我未指定任何内容,默认的Node.js运行时版本是什么?
  2. Can I specify multiple node versions (say 0.10.x and 0.12.x) when I deploy to bluemix? 部署到bluemix时是否可以指定多个节点版本(例如0.10.x和0.12.x)? Or I need to deploy twice, one to each version? 还是我需要部署两次,每个版本一个?

Thanks in advance. 提前致谢。

"engines": {
  "node": "^0.10.*",
  "node": "^0.12.*"
} 

Thanks in advance 提前致谢

The current default version of node.js in Bluemix is 0.10.x. Bluemix中的node.js当前的默认版本是0.10.x。 However, the default buildpack is set to be bumped to 0.12.x in the near future. 但是,默认的buildpack设置为在不久的将来会升至0.12.x。

I recommend that you always specify the buildpack, as the default version may change without direct communication with owners of node.js apps on Bluemix. 我建议您始终指定buildpack,因为默认版本可能会更改,而无需与Bluemix上的node.js应用程序所有者直接通信。

You are not able to specify multiple node versions within a single package.json file. 您无法在单个package.json文件中指定多个节点版本。 If you want a 0.10.x and 0.12.x version of your app deployed at the same time, you will need two separate applications. 如果要同时部署0.​​10.x和0.12.x版本的应用程序,则需要两个单独的应用程序。

Currently, Bluemix provides four versions of IBM SDK for Node.js runtime. 当前,Bluemix为Node.js运行时提供了四个版本的IBM SDK。 They are v0.10.21, v0.10.25, v0.10.26 and v0.10.28. 它们是v0.10.21,v0.10.25,v0.10.26和v0.10.28。 These versions contain IBM enhancements and bug fixes. 这些版本包含IBM增强功能和错误修复。

You should always specify a node version(single) in the package.json file. 您应该始终在package.json文件中指定节点版本(单个)。 But if you don't, the latest version will be used. 但是,如果不这样做,将使用最新版本。

More details are here: 更多详细信息在这里:

https://www.ng.bluemix.net/docs/#starters/nodejs/index.html#deploynodejsapp https://www.ng.bluemix.net/docs/#starters/nodejs/index.html#deploynodejsapp

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM