Installing v8-profiler using npm

While trying

npm install -g v8-profiler

I'm hitting the below errors:

..\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

Looks like a compilation issue. What might be wrong ? My system has :

  1. Visual Studio 2010
  2. Windows SDK 7.1 Note: If you get error on installation, maybe this link will help you.
  3. Visual Studio 2010 SP1
  4. Visual C++ 2010 SP1 Compiler Update for the Windows SDK 7.1
  5. Python 2.7

As mentioned in : https://github.com/TooTallNate/node-gyp/wiki/Visual-Studio-2010-Setup

I just ran into this same issue. It looks like NodeFly's fork of v8-profiler contains the fix that Sean described, so I installed that version instead:

npm install nodefly-v8-profiler

According to this comment on GitHub, some APIs were removed from V8, and v8-profiler hasn't been updated.

It was V8 problem.
v8-profiler uses some V8 API's, but those API's are eliminated from V8 in version 3.11.5.

...

In order to use v8-profiler, simplest way is to remove the following methods and SetAccessor call inside constructor from graph_node.cc and rebuild v8-profiler.

  • GraphNode::GetRetainersCount
  • GraphNode::GetRetainedSize
  • GraphNode::GetRetainer
  • GraphNode::GetDominator

But of course, if you do this, you can't see anymore dominator and retainer informations.