gpt4 book ai didi

node.js - 如何以 root 身份访问 Bluemix 应用程序的运行时 shell?

转载 作者:搜寻专家 更新时间:2023-10-31 23:57:53 46 4
gpt4 key购买 nike

我有一个在 Bluemix 中运行的 Nodejs 应用程序。我尝试运行命令在 Nodejs 应用程序容器中安装依赖项。我使用应用程序的运行时 SSH 访问它。我需要 root 权限来安装依赖项。它问我 sudo 命令的密码。我怎样才能得到那个密码?

enter image description here

最佳答案

您不应该以这种方式安装依赖项。 ssh 终端仅用于调试目的:

If you need to troubleshoot an instance of an app, you can gain SSH access to the app using the SSH proxy and daemon.

For example, one of your app instances may be unresponsive, or the log output from the app may be inconsistent or incomplete. You can SSH into the individual VM that runs the problem instance to troubleshoot.

来源:https://docs.cloudfoundry.org/devguide/deploy-apps/app-ssh-overview.html

可以通过添加 package.json 文件来安装 NodeJS 依赖项:

Cloud Foundry expects a package.json in your Node.js app. You can specify the version of Node.js you want to use in the engine node of your package.json file.

In general, Cloud Foundry supports the two most recent versions of Node.js. See the GitHub Node.js buildpack page for current information.

来源:https://docs.cloudfoundry.org/buildpacks/node/node-tips.html

关于node.js - 如何以 root 身份访问 Bluemix 应用程序的运行时 shell?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48145124/

46 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com