- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我自己解决了这个问题,但没有从网络上的其他答案中找到太多帮助,所以我想我会将我的答案发布在这里,以供其他可能遇到相同问题的人使用。
尝试安装 PM2 分析器来找出导致 NodeJS 应用程序内存泄漏的原因,但在安装过程中出现以下错误:
$ pm2 install profiler
[PM2][Module] Installing module profiler
[PM2][Module] Calling [NPM] to install v8-profiler-node8 ...
npm ERR! Error: CERT_UNTRUSTED
npm ERR! at SecurePair.<anonymous> (tls.js:1430:32)
npm ERR! at SecurePair.emit (events.js:92:17)
npm ERR! at SecurePair.maybeInitFinished (tls.js:1029:10)
npm ERR! at CleartextStream.read [as _read] (tls.js:521:13)
npm ERR! at CleartextStream.Readable.read (_stream_readable.js:341:10)
npm ERR! at EncryptedStream.write [as _write] (tls.js:418:25)
npm ERR! at doWrite (_stream_writable.js:226:10)
npm ERR! at writeOrBuffer (_stream_writable.js:216:5)
npm ERR! at EncryptedStream.Writable.write (_stream_writable.js:183:11)
npm ERR! at write (_stream_readable.js:602:24)
npm ERR! If you need help, you may report this log at:
npm ERR! <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR! <npm-@googlegroups.com>
npm ERR! System Linux 2.6.32-696.20.1.el6.x86_64
npm ERR! command "node" "/usr/bin/npm" "install" "v8-profiler-node8" "--loglevel=error"
npm ERR! cwd /usr/lib/node_modules/pm2
npm ERR! node -v v0.10.48
npm ERR! npm -v 1.3.6
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /usr/lib/node_modules/pm2/npm-debug.log
npm ERR! not ok code 0
[PM2][Module][ERROR] Profiling installation has FAILED (checkout previous logs)
[PM2][ERROR] Module install failed
互联网上的很多帖子建议更改 NPM 设置以忽略证书或忽略 https,但这没有帮助:
https://stackoverflow.com/a/45884819/884842 https://github.com/nodejs/node/issues/3742#issuecomment-155545828
这是在运行 CentOS 6.10 的服务器上
最佳答案
安装中的错误与 SSL 证书有关,但这有点误导。虽然具体错误是由于 SSL 证书不受信任造成的,但实际上是因为 PM2 安装过程使用的 NodeJS 和 NPM 版本较旧,使用了过时的证书。
在错误中,您可以看出 NodeJS 和 NPM 版本非常旧:
npm ERR! node -v v0.10.48
npm ERR! npm -v 1.3.6
但是,当我在命令行上检查 NodeJS 和 NPM 版本时,它们是更新的:
$ node -v
v7.6.0
$ npm -v
4.1.2
在安装 NPM 软件包之前,我也遇到过类似的问题,更新 NodeJS/NPM 已经解决了该问题,但在这种情况下,据我所知,与 PM2 安装程序尝试使用的版本相比,我确实拥有更新版本的 NodeJS 和 NPM。
这里的关键是查看错误日志并发现这一点:
npm ERR! command "node" "/usr/bin/npm" "install" "v8-profiler-node8" "--loglevel=error"
具体来说,/usr/bin/npm
PM2 使用 /usr/bin
文件夹中的 NPM(我假设是 NodeJS),但是当我使用 which
命令时...
$ which node
/usr/local/bin/node
$ which npm
/usr/local/bin/npm
...我们可以看到 PM2 正在寻找的地方没有安装较新的版本(7.6.0 和 4.1.2)。
当我设置此服务器时,我可能手动安装了 NodeJS 和 NPM,早在 NodeJS 发布之前。
从那时起我就开始使用 NVM [ https://github.com/creationix/nvm]安装更新版本。
现在我不知道我的修复是否是解决这个问题的最佳方法,但它对我有用。我删除了 /usr/bin
中的 NodeJS 和 NPM 安装,并添加了指向较新 /usr/local/bin
版本的符号链接(symbolic link)。
# check we're in the /usr/bin folder
$ pwd
/usr/bin
#######################
# SORTING OUT NPM FIRST
#######################
# npm version in the bash environment
$ npm -v
4.1.2
# npm version for the install at /usr/bin/npm
$ ./npm -v
1.3.6
# get rid of the version here in /usr/bin and add link back to the /usr/local/bin version
$ sudo rm npm
$ sudo ln -s /usr/local/bin/npm npm
# npm version in the bash environment
$ npm -v
4.1.2
# npm version for the install at /usr/bin/npm - now linking to the newer one
$ ./npm -v
4.1.2
##################
# SORTING OUT NODE
##################
# node version in the bash environment
$ node -v
v7.6.0
# node version for the install at /usr/bin/node
$ ./node -v
v0.10.48
# get rid of the version here in /usr/bin and add link back to the /usr/local/bin version
$ sudo rm node
$ sudo ln -s /usr/local/bin/node node
$ node -v
v7.6.0
$ ./node -v
v7.6.0
我实际上先做了 Node,但没有帮助(这是一个稍微不同的 UNABLE_TO_GET_ISSUER_CERT_LOCALLY
证书错误,而不是 CERT_UNTRUSTED
,然后我整理了 NPM。
您也许可以通过整理 NPM 安装来完成此操作,但我做了 Node,然后 NPM 和 PM2 分析器现在已成功安装,所以这就是我给出的答案。
关于node.js - 多个 NPM 和 NodeJS 版本导致安装 PM2 Profiler 时出现 SSL/证书问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51440823/
在 Python 2.7 和 Python 3.6 中,我发现这有效: from cProfile import Profile; p = Profile(); p.enable() ...而这引发了
我正在尝试在 Windows 8 PRO 64 位上的 Visual Studio 2012 RTM 中为控制台程序启动性能分析 session (分析/启动性能分析)。 我收到一条弹出消息通知我 C
我在 windows 上有一个应用程序,它在单声道上运行得很好。但是,当我尝试对其进行分析时: mono --profile=log program.exe 我得到: The 'log' profil
我正在尝试使用 Django 创建注册表单。我在提交表单时收到此错误。 这就是我所做的。 models.py from django.db import models from django.cont
是否可以从 Flash Builder 导出分析结果? 我需要它们,因为我想根据方法名称进行过滤,但 Flash Builder 的内置过滤不允许这样做。 最佳答案 它隐藏在 GUI 的一个完全隐蔽、
我真的很喜欢热图,但我需要的是热图背后的数字(又名相关矩阵)。 有没有简单的方法来提取数字? 最佳答案 从文档开始追踪有点困难;具体来说 来自 report structure然后深入研究以下函数 g
我有一个 POM,它声明了我的项目常见的 Web 应用程序内容。我将它用作所有 Web 应用程序的父级。 是否可以仅在包装为 war 时激活配置文件?我已经尝试过属性方法,但这不起作用(因为它不是系统
在数据帧上运行 pandas-profiling 时,我看到它将索引分析为一个变量。注意:我的索引是唯一键(命名为UUID) 有没有办法排除引入索引上报? 我知道我可以在 pandas 中删除它,但在
在数据帧上运行 pandas-profiling 时,我看到它将索引分析为一个变量。注意:我的索引是唯一键(命名为UUID) 有没有办法排除引入索引上报? 我知道我可以在 pandas 中删除它,但在
我正在使用 Intel Vtune 来分析需要在另一台机器上进行 sudo 访问的远程应用程序。之前我已经能够在不需要 sudo 访问的那台机器上分析远程应用程序,但英特尔 Vtune 不适用于需要
我已经在我的 MVC 4 应用程序上安装了 Mini-Profiler,它运行得非常棒。我遇到的唯一问题是 UI 覆盖了我 UI 的关键部分。我可以使用 css 在页面上移动它,但理想情况下我想这样做
在使用 Chrome devtools 分析堆快照时,我似乎无法弄清楚查看分离的 DOM 树时颜色的含义。红色和黄色有什么区别? 最佳答案 有很好的解释available here . 从文章: Re
分析器中 SQL Server 跟踪的输出包含 CPU 和持续时间列(以及其他列)。这些值的单位是什么? 最佳答案 CPU 以毫秒为单位。在 sql server 2005 及更高版本中,保存到文件或
我有一个奇怪的问题,我正在使用 MiniProfiler,它很棒,在我的本地机器上没有任何问题,但它在我们的测试服务器上的表现似乎有所不同。它似乎会生成许多对 mini-profiler-resour
我想知道优先级 的application-{profile}.properties文件,如果有多个 spring.profiles.active添加。 例如: 比方说,我有这个 spring.prof
我有一个名为“isActive”的助手和一个名为“create”的模板.. 见下文 Template.create.isActive = function () { return Meteor.u
这是我面临的场景:我正在使用 MiniProfiler 来分析一些操作。但它缺少我必须使用的特定功能。有一个设置文件 MiniProfiler 可以让我做一些配置,比如分析什么考虑什么,什么不考虑,什
哇,这完全令人困惑,而且 dojo 1.8 文档似乎是围绕构建层的完整 clusterf**k。有人知道那里发生了什么吗? 在构建脚本示例配置文件中,示例 amd.profile.js 有 profi
我正在为一个内部项目使用出色的 MVC Mini Profiler,但希望它能够显示时间信息,无论您是谁。理想情况下,如果用户是站点的管理员或开发人员,我希望能够显示完整的分析信息,如果用户只是标准用
打开Android Profiler编译出现如下错误: FAILURE:构建失败并出现异常。 什么地方出了错: Execution failed for task ':app:transformCla
我是一名优秀的程序员,十分优秀!