在尝试中
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
看起来像是一个编译问题。可能出了什么问题? 我的系统有:
- Visual Studio 2010
- Windows SDK 7.1 注意:如果你在安装时遇到错误,可能是这个 链接将为您提供帮助。
- Visual Studio 2010 SP1
- 适用于 Windows SDK 7.1 的 Visual C++ 2010 SP1 编译器更新
- 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/