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