简体   繁体   English

IBM Bluemix Cloud:用于Node.js的IBM SDK-Bluemix中的应用程序能否保留现有版本而无需自动更新?

[英]IBM Bluemix Cloud: IBM SDK for Node.js - Can our apps in Bluemix keep the existing version without auto-updates?

We tried to test IBM Bluemix Cloud and Watson Cloud by running 我们尝试通过运行来测试IBM Bluemix Cloud和Watson Cloud
several Watson Cloud demo node.js apps inside our accounts, we 我们帐户中的几个Watson Cloud演示node.js应用程序,我们
noticed the following situation: 注意以下情况:

After we installed the demo apps inside our account, it runs without problem; 在我们的帐户中安装演示应用程序后,它可以正常运行; Because I have not opened this app in Bluemix DevOps tool. 因为我尚未在Bluemix DevOps工具中打开此应用程序。 So, when this app runs each time, this app does the following based on staging_task.log file: 因此,每次运行此应用程序时,该应用程序都会根据staging_task.log文件执行以下操作:

 "" Installing IBM SDK for Node.js (4.5.0)from cache"""" 

The above app frontend js code is written to work with this SDK and Node.js version. 上面的应用程序前端js代码被编写为与此SDK和Node.js版本一起使用。

# Later, I made another copy of the above demo app in our account. #后来,我在我们的帐户中复制了上面的演示应用程序。 It runs without problem. 它运行没有问题。 Then, I just opened the above app code in Bluemix DevOps tool and saved the file without touching any code. 然后,我只是在Bluemix DevOps工具中打开了上面的应用程序代码,然后保存文件而没有碰到任何代码。 Then, this version app does not run. 然后,此版本的应用程序无法运行。

Our investigation shows the following: 我们的调查显示以下内容:

  • This staging_task.log file shows this fact: This version app after the above step does this now: staging_task.log文件显示了以下事实:经过上述步骤后,此版本的应用程序现在执行此操作:
    """ Installing IBM SDK for Node.js (4.6.2) from cache """ “”“从缓存安装IBM SDK for Node.js(4.6.2)

    That means Bluemix Cloud automatically use the newer version of Node.js and SDK after the above step. 这意味着Bluemix Cloud在上述步骤之后会自动使用更新版本的Node.js和SDK。

Another situation we found during our experiments may also be related to this problem: 我们在实验中发现的另一种情况也可能与此问题有关:

*We deployed the following Watson demo app around Aug/2016, and we have not resaved any file in this app, so we guess that this demo app still runs in the cached Run Environment (IBM SDK for Node.js Verson 4 ??) in our account in Bluemix. *我们在2016年8月左右部署了以下Watson演示应用程序,并且尚未在该应用程序中重新保存任何文件,因此我们猜测该演示应用程序仍在缓存的运行环境中运行(适用于Node.js Verson 4的IBM SDK)。在我们的Bluemix帐户中。 So this demo app runs fast and correctly in our account. 因此,该演示应用程序可以在我们的帐户中快速且正确地运行。 https://github.com/watson-developer-cloud/conversation-simple https://github.com/watson-developer-cloud/conversation-simple

*After the above deployment, there are several upgrading in Bluemix Cloud and Watson Cloud. *在完成上述部署之后,Bluemix Cloud和Watson Cloud进行了几次升级。 The Run Environment many contains IBM SDK for Node.js Verson 6 ?? 运行环境很多包含用于Node.js Verson 6的IBM SDK。

*In last month, we deployed the above same demo app in our account. *在上个月,我们在帐户中部署了上述相同的演示应用程序。 We found that this same app runs much slower than the above Aug/2016 deployment. 我们发现,同一个应用程序的运行速度比上述2016年8月部署的速度慢得多。 Our guesses are that this demo app code is engineered based on IBM SDK for Node.js Verson 4. 我们的猜测是,此演示应用程序代码是基于IBM SDK for Node.js Verson 4设计的。

The following Q supports our point: The auto-upgraded IBM SDK for Node.js in Bluemix Cloud or Watson Cloud may 以下Q支持我们的观点:Bluemix Cloud或Watson Cloud中针对Node.js的自动升级的IBM SDK可能会

have caused the problem in this Q. Now the IBM SDK for Node.js in Bluemix Cloud may be Version 6, this application may be engineered based on IBM SDK for Node.js Verson 4 (this version is not Node.js version in Package.json, but IBM SDK version) IBM Bluemix node.js native promise support 已经在此Q中引起了问题。现在,Bluemix Cloud中用于Node.js的IBM SDK可能是版本6,此应用程序可能是基于用于Node.js Verson 4的IBM SDK设计的(此版本不是Package中的Node.js版本.json,但IBM SDK版本) IBM Bluemix node.js本机承诺支持

Our Q: 我们的问:

-Why is the above SDK and Node.js auto-upgraded ? -为什么上述SDK和Node.js会自动升级?
-How can we force this demo app to use the same version of IBM SDK and Node.js before we decide to upgrade them in Bluemix Cloud? -在决定在Bluemix Cloud中进行升级之前,如何强制该演示应用程序使用相同版本的IBM SDK和Node.js? Thus to ensure that our existing apps run as normal. 从而确保我们现有的应用正常运行。

Any thoughts and suggestions will be appreciated. 任何想法和建议将不胜感激。

You can define node and npm versions in your package.json 您可以在package.json中定义节点和npm版本

{
   "name":"iot-html5-phone",
   "version":"0.0.1",
   "scripts":{
      "start":"node app.js"
   },
   "dependencies":{

   },
   "engines":{
      "node":"0.10.26"
   }
}

Use: 采用:

"engines":{
   "node":"4.5.0"
}

( no carets or tildes ) (没有尖号或波浪号)

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

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