【问题标题】:Install memwatch on Node v14, Windows 10在 Node v14、Windows 10 上安装 memwatch
【发布时间】:2020-11-23 13:20:49
【问题描述】:

我正在尝试使用以下方法安装 memwatch: 节点 v14.15.0、npm 6.14.9 和 Windows 10,但没有运气。

最近有人能安装这个吗?

我已关注instructions for node-gyp 并使用“Visual C++ 构建工具”安装了 Visual Studio 2019

谢谢

日志:

PS C:\Users\Shaan\dev\monitor> npm install memwatch

> memwatch@0.2.2 install C:\Users\Shaan\dev\monitor\node_modules\memwatch
> node-gyp rebuild


C:\Users\Shaan\dev\monitor\node_modules\memwatch>if not defined npm_config_node_gyp (node "C:\Users\Shaan\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "C:\Users\Shaan\AppData\Roaming\npm\node_modules\npm\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.
  heapdiff.cc
  init.cc
  memwatch.cc
  util.cc
  win_delay_load_hook.cc
C:\Users\Shaan\dev\monitor\node_modules\memwatch\src\memwatch.hh(12,9): error C2039: 'Handle': is not a member of 'v8' (compiling source file ..\src\memwatch.cc) [C:\Users\Shaan\dev\monitor\node_modul
es\memwatch\build\memwatch.vcxproj]
C:\Users\Shaan\AppData\Local\node-gyp\Cache\14.15.0\include\node\v8-platform.h(16): message : see declaration of 'v8' (compiling source file ..\src\memwatch.cc) [C:\Users\Shaan\dev\monitor\node_module 
s\memwatch\build\memwatch.vcxproj]
C:\Users\Shaan\dev\monitor\node_modules\memwatch\src\memwatch.hh(12,15): error C2143: syntax error: missing ';' before '<' (compiling source file ..\src\memwatch.cc) [C:\Users\Shaan\dev\monitor\node_m 
odules\memwatch\build\memwatch.vcxproj]

...

C:\Users\Shaan\dev\monitor\node_modules\memwatch\src\memwatch.hh(10): message : see declaration of 'memwatch' [C:\Users\Shaan\dev\monitor\node_modules\memwatch\build\memwatch.vcxproj]
C:\Users\Shaan\dev\monitor\node_modules\memwatch\src\memwatch.cc(249,59): error C2143: syntax error: missing ';' before '{' [C:\Users\Shaan\dev\monitor\node_modules\memwatch\build\memwatch.vcxproj]    
C:\Users\Shaan\dev\monitor\node_modules\memwatch\src\memwatch.cc(249,59): error C2447: '{': missing function header (old-style formal list?) [C:\Users\Shaan\dev\monitor\node_modules\memwatch\build\mem 
watch.vcxproj]
gyp ERR! build error 
gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\MSBuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Users\Shaan\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:315:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)
gyp ERR! System Windows_NT 10.0.18363
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Shaan\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\Shaan\dev\monitor\node_modules\memwatch
gyp ERR! node -v v14.15.0
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! memwatch@0.2.2 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the memwatch@0.2.2 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Shaan\AppData\Roaming\npm-cache\_logs\2020-11-23T13_14_40_166Z-debug.log
PS C:\Users\Shaan\dev\monitor>

【问题讨论】:

标签: node.js node-memwatch


【解决方案1】:

尝试使用 node-memwatch-new@0.0.1

【讨论】:

  • node 14.15.3 npm 6.14.9 node-gyp 8.4.1 应该可以使用 node-memwatch-new
  • 而不是添加“这应该工作......”作为答案提供了详细的答案,实际上会提供问题的答案。
  • 听不懂你的意思~
  • Windows 中的@airbnb/node-memwatch 仍然存在一些错误。所以我分叉了他们的仓库并发布了一个没有错误的新 npm。
猜你喜欢
  • 2015-05-17
  • 1970-01-01
  • 2018-04-07
  • 2019-03-26
  • 1970-01-01
  • 1970-01-01
  • 2017-06-14
  • 2021-03-15
  • 2018-03-22
相关资源
最近更新 更多