2

v8-profiler 是跟踪 node.js 应用程序内存泄漏的“标准”。

当我尝试使用安装它时,npm install v8-profiler我收到一条错误消息,似乎在抱怨 32 位与 64 位编译。

C:\Users\fmcdowall\Desktop\node\norch>npm install v8-profiler
npm WARN package.json norch@0.2.1 No repository field.
npm WARN package.json search-index@0.2.8 No repository field.
npm http GET https://registry.npmjs.org/v8-profiler
npm http 304 https://registry.npmjs.org/v8-profiler

> v8-profiler@3.6.2-1 install C:\Users\fmcdowall\Desktop\node\norch\node_modules
\v8-profiler
> node-gyp rebuild


C:\Users\fmcdowall\Desktop\node\norch\node_modules\v8-profiler>node "C:\Program
Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\
node-gyp.js" rebuild
Building the projects in this solution one at a time. To enable parallel build,
please add the "/m" switch.
  profile_node.cc
  heap_profiler.cc
  cpu_profiler.cc
  graph_edge.cc
  snapshot.cc
  graph_node.cc
..\graph_node.cc(76): warning C4244: 'argument' : conversion from 'uint64_t' to
 'uint32_t', possible loss of data [C:\Users\fmcdowall\Desktop\node\norch\node_
modules\v8-profiler\build\profiler.vcxproj]
..\graph_node.cc(84): warning C4244: 'argument' : conversion from 'uint64_t' to
 'uint32_t', possible loss of data [C:\Users\fmcdowall\Desktop\node\norch\node_
modules\v8-profiler\build\profiler.vcxproj]
..\graph_node.cc(99): error C2039: 'GetRetainersCount' : is not a member of 'v8
::HeapGraphNode' [C:\Users\fmcdowall\Desktop\node\norch\node_modules\v8-profile
r\build\profiler.vcxproj]
          C:\Users\fmcdowall\.node-gyp\0.10.15\deps\v8\include\v8-profiler.h(24
  9) : see declaration of 'v8::HeapGraphNode'
..\graph_node.cc(132): error C2039: 'GetRetainedSize' : is not a member of 'v8:
:HeapGraphNode' [C:\Users\fmcdowall\Desktop\node\norch\node_modules\v8-profiler
\build\profiler.vcxproj]
          C:\Users\fmcdowall\.node-gyp\0.10.15\deps\v8\include\v8-profiler.h(24
  9) : see declaration of 'v8::HeapGraphNode'
..\graph_node.cc(154): error C2039: 'GetRetainer' : is not a member of 'v8::Hea
pGraphNode' [C:\Users\fmcdowall\Desktop\node\norch\node_modules\v8-profiler\bui
ld\profiler.vcxproj]
          C:\Users\fmcdowall\.node-gyp\0.10.15\deps\v8\include\v8-profiler.h(24
  9) : see declaration of 'v8::HeapGraphNode'
..\graph_node.cc(162): error C2039: 'GetDominatorNode' : is not a member of 'v8
::HeapGraphNode' [C:\Users\fmcdowall\Desktop\node\norch\node_modules\v8-profile
r\build\profiler.vcxproj]
          C:\Users\fmcdowall\.node-gyp\0.10.15\deps\v8\include\v8-profiler.h(24
  9) : see declaration of 'v8::HeapGraphNode'
  profiler.cc
C:\Users\fmcdowall\.node-gyp\0.10.15\deps\v8\include\v8.h(184): warning C4506:
no definition for inline function 'v8::Persistent<T> v8::Persistent<T>::New(v8:
:Handle<T>)' [C:\Users\fmcdowall\Desktop\node\norch\node_modules\v8-profiler\bu
ild\profiler.vcxproj]
          with
          [
              T=v8::Object
          ] (..\cpu_profiler.cc)
C:\Users\fmcdowall\.node-gyp\0.10.15\deps\v8\include\v8.h(184): warning C4506:
no definition for inline function 'v8::Persistent<T> v8::Persistent<T>::New(v8:
:Handle<T>)' [C:\Users\fmcdowall\Desktop\node\norch\node_modules\v8-profiler\bu
ild\profiler.vcxproj]
          with
          [
              T=v8::Object
          ] (..\heap_profiler.cc)
  profile.cc
..\snapshot.cc(90): warning C4244: 'argument' : conversion from 'uint64_t' to '
v8::SnapshotObjectId', possible loss of data [C:\Users\fmcdowall\Desktop\node\n
orch\node_modules\v8-profiler\build\profiler.vcxproj]
C:\Users\fmcdowall\.node-gyp\0.10.15\deps\v8\include\v8.h(184): warning C4506:
no definition for inline function 'v8::Persistent<T> v8::Persistent<T>::New(v8:
:Handle<T>)' [C:\Users\fmcdowall\Desktop\node\norch\node_modules\v8-profiler\bu
ild\profiler.vcxproj]
          with
          [
              T=v8::Object
          ] (..\snapshot.cc)
C:\Users\fmcdowall\.node-gyp\0.10.15\deps\v8\include\v8.h(179): warning C4506:
no definition for inline function 'v8::Persistent<T> v8::Persistent<T>::New(v8:
:Handle<T>)' [C:\Users\fmcdowall\Desktop\node\norch\node_modules\v8-profiler\bu
ild\profiler.vcxproj]
          with
          [
              T=v8::Object
          ] (..\profiler.cc)
gyp ERR! build error
gyp ERR! stack Error: `C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe
` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\
npm\node_modules\node-gyp\lib\build.js:267:23)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:789:
12)
gyp ERR! System Windows_NT 6.2.9200
gyp ERR! command "node" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modu
les\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\fmcdowall\Desktop\node\norch\node_modules\v8-profiler
gyp ERR! node -v v0.10.15
gyp ERR! node-gyp -v v0.10.6
gyp ERR! not ok
npm ERR! weird error 1
npm ERR! not ok code 0

如何在 windows 8 上安装 v8-profiler 模块?

4

1 回答 1

2

就我而言,这与 x64 无关。原因是该插件是为旧 Node(如 0.3)设计的,它与 0.10 中断。您需要查看模块的分支以查看修复。这似乎是最正确和最受节点检查员支持的

https://github.com/nodefly/nodefly-v8-profiler

我已经用删除的堆分析器尝试过这个,它实际上已经坏了

npm install git://github.com/tonistiigi/v8-profiler.git#remove-heap-profiler
于 2013-09-29T20:29:37.150 回答