Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/cmake/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Node.js 我添加了一个与节点gyp相关的自定义_目标,但报告了一个错误,即找不到VS_Node.js_Cmake - Fatal编程技术网

Node.js 我添加了一个与节点gyp相关的自定义_目标,但报告了一个错误,即找不到VS

Node.js 我添加了一个与节点gyp相关的自定义_目标,但报告了一个错误,即找不到VS,node.js,cmake,Node.js,Cmake,这是我的项目结构: / CMakelists.txt ... /node binding.gyp ... 在CMakelists.txt中: option(NEED_COMPILE_NODE_BINDING ON) if(NEED_COMPILE_NODE_BINDING) add_custom_target(node_binding ALL COMMAND node-gyp rebuild WORKING_DIRECTORY ${CMAKE_CURR

这是我的项目结构:

/
 CMakelists.txt
 ...
 /node
      binding.gyp
      ...
在CMakelists.txt中:

option(NEED_COMPILE_NODE_BINDING ON)

if(NEED_COMPILE_NODE_BINDING)
add_custom_target(node_binding ALL 
  COMMAND node-gyp rebuild
  WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/node
  )
endif()
它的报告:

[build]   gyp ERR! find VS 
[build]   gyp ERR! find VS msvs_version not set from command line or npm config
[build]   gyp ERR! find VS VCINSTALLDIR not set, not running in VS Command Prompt
[build]   gyp ERR! find VS could not use PowerShell to find Visual Studio 2017 or newer
[build]   gyp ERR! find VS looking for Visual Studio 2015
[build]   gyp ERR! find VS - not found
[build]   gyp ERR! find VS not looking for VS2013 as it is only supported up to Node.js 8
[build]   gyp ERR! find VS 
[build]   gyp ERR! find VS **************************************************************
[build]   gyp ERR! find VS You need to install the latest version of Visual Studio
[build]   gyp ERR! find VS including the "Desktop development with C++" workload.
[build]   gyp ERR! find VS For more information consult the documentation at:
[build]   gyp ERR! find VS https://github.com/nodejs/node-gyp#on-windows
[build]   gyp ERR! find VS **************************************************************
[build]   gyp ERR! find VS 
[build]   gyp ERR! configure error 
但是,如果我进入
节点
目录并直接在powershell中使用该命令,它将不会报告错误

我需要做点什么吗

thx