node.js - 使用 npm 安装 v8-profiler

标签 node.js npm v8

在尝试中

npm install -g v8-profiler

我遇到了以下错误:

..\graph_node.cc(99): error C2039: 'GetRetainersCount' : is not a member of 'v8::HeapGraphNode' [C:\Users\username\AppData\Roaming\npm\node_modules\v8
-profiler\build\profiler.vcxproj]
          C:\Users\username\.node-gyp\0.10.15\deps\v8\include\v8-profiler.h(249) : see declaration of 'v8::HeapGraphNode'
..\graph_node.cc(132): error C2039: 'GetRetainedSize' : is not a member of 'v8::HeapGraphNode' [C:\Users\username\AppData\Roaming\npm\node_modules\v8-
profiler\build\profiler.vcxproj]
          C:\Users\username\.node-gyp\0.10.15\deps\v8\include\v8-profiler.h(249) : see declaration of 'v8::HeapGraphNode'
..\graph_node.cc(154): error C2039: 'GetRetainer' : is not a member of 'v8::HeapGraphNode' [C:\Users\username\AppData\Roaming\npm\node_modules\v8-prof
iler\build\profiler.vcxproj]
          C:\Users\username\.node-gyp\0.10.15\deps\v8\include\v8-profiler.h(249) : see declaration of 'v8::HeapGraphNode'
..\graph_node.cc(162): error C2039: 'GetDominatorNode' : is not a member of 'v8::HeapGraphNode' [C:\Users\username\AppData\Roaming\npm\node_modules\v8
-profiler\build\profiler.vcxproj]
          C:\Users\username\.node-gyp\0.10.15\deps\v8\include\v8-profiler.h(249) : see declaration of 'v8::HeapGraphNode'
  profiler.cc

看起来像是一个编译问题。可能出了什么问题? 我的系统有:

  1. Visual Studio 2010
  2. Windows SDK 7.1 注意:如果你在安装时遇到错误,可能是这个 链接将为您提供帮助。
  3. Visual Studio 2010 SP1
  4. 适用于 Windows SDK 7.1 的 Visual C++ 2010 SP1 编译器更新
  5. python 2.7

如中所述:https://github.com/TooTallNate/node-gyp/wiki/Visual-Studio-2010-Setup

最佳答案

我刚遇到同样的问题。看起来像 NodeFly's fork of v8-profiler包含 Sean 描述的修复,所以我安装了那个版本:

npm install nodefly-v8-profiler

关于node.js - 使用 npm 安装 v8-profiler,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18039287/

相关文章:

node.js - NPM 7.0.0 的工作空间是否需要 Lerna?

node.js - npm 链接导致 "extraneous"错误

javascript - 传递给函数的对象的内存使用/垃圾收集

node.js - 如何为第 3 方库将 ES6 转换为 ES5?

node.js - Beanstalk : Node. js 部署-node-gyp 由于权限被拒绝而失败

javascript - 如何使用angular cli升级次要版本的angular

javascript - v8 中的和谐代理

javascript - 谁能解释 V8 字节码 LdaTheHole?

javascript - Express Session 不同的到期时间

node.js - 使用 webpack 导入 monaco-editor 时找不到依赖项