【问题标题】:Node Gui installation can't find CmakeNode Gui安装找不到Cmake
【发布时间】:2021-10-15 06:52:47
【问题描述】:

我正在尝试按照他们的文档安装 nodegui,但即使我已经安装了它(以及 Visual Studio 2019),它似乎也找不到 Cmake。这是错误:

> cross-env CMAKE_BUILD_PARALLEL_LEVEL=8 cmake-js compile

[
  'C:\\Program Files\\nodejs\\node.exe',
  'C:\\Users\\giova\\Coding projects\\Node_Gui\\Tutorial_1\\nodegui-starter\\node_modules\\cmake-js\\bin\\cmake-js',
  'compile'
]
ERR! OMG CMake is not installed. Install CMake.
ERR! OMG CMake is not installed. Install CMake.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @nodegui/nodegui@0.36.0 build:addon: `cross-env CMAKE_BUILD_PARALLEL_LEVEL=8 cmake-js compile`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @nodegui/nodegui@0.36.0 build:addon script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\giova\AppData\Roaming\npm-cache\_logs\2021-10-15T06_47_38_675Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @nodegui/nodegui@0.36.0 postinstall: `cross-env npm run setupqt && (node ./scripts/skip.js || npm run build:addon)`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @nodegui/nodegui@0.36.0 postinstall 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\giova\AppData\Roaming\npm-cache\_logs\2021-10-15T06_47_39_666Z-debug.log

【问题讨论】:

  • 当您在终端上输入cmake --version 时,它会显示cmake 版本吗?
  • 是:cmake 版本 3.20.6
  • 我也试过3.21,但没有任何变化

标签: node.js qt npm cmake


【解决方案1】:

我想我通过将C:\Program Files\CMake\bin 添加到 PATH 环境变量来解决了这个问题,就像这里:https://www.youtube.com/watch?v=8_X5Iq9niDE。 我不是 100% 确定这是实际的解决方案,因为我在那之前尝试过随机的东西,但可能这是正确的方法。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-12-22
    • 2018-03-19
    • 2022-06-23
    • 2020-11-29
    • 2021-02-27
    相关资源
    最近更新 更多