如何在 Redhat 的 OpenShift 和 运行 上全局安装 Node-Inspector?

How do I install Node-Inspector globally on Redhat's OpenShift and run it?

我无法在网上或 OpenShift 上找到任何关于如何全局安装 npm 模块的参考资料。如他们的文档中所述,我想全局安装 Node-Inspector。当我进入我的 OpenShift Node.js 齿轮和 运行 "npm install -g Node-Inspector" 时,我得到了非常意外的 "npm ERR! 404 'Node-Inspector' is not in the npm registry"。当我 运行 使用 sudo 命令时,OpenShift returns 预期:权限被拒绝。

运行 我的 Mac 上的这 2 个命令中的任何一个都安装了 Node-Inspector 模块。

OpenShift 在其云环境中全局安装 npm 模块的预期设计方法是什么,以便我可以安装 Node-Inspector 模块?

根据问题,这里没有直接确定答案,但解决方案在这里:https://developers.openshift.com/languages/nodejs/dependency-management.html

基本上,您在本地开发系统上手动编辑 node.js 应用程序的 package.json,添加节点检查器模块。当您将应用程序发送到您的 Openshift 设备时,OpenShift 会将其识别为全局模块,因为它尚未作为本地模块安装并将其全局安装。

这解决了安装问题。我已经让 node-inspector 开始了,因为我在命令行上看到它的横幅,但它随后无法打开端口 5858 的套接字。但我会提出一个新问题。