I have seen many tutorials about running c++ files with node. Most of these tutorials are using a package called node-gyp
. I've tried to install this via npm with
npm i node-gyp -g
and it works. The problems occurs when I configure the node-gyp using:
node-gyp configure
When i use this command it throws this error:
gyp info it worked if it ends with ok
gyp info using node-gyp@6.1.0
gyp info using node@12.13.1 | win32 | x64
gyp info find Python using Python version 3.8.0 found at "...Path to Python"
gyp ERR! find VS
gyp ERR! find VS msvs_version not set from command line or npm config
gyp ERR! find VS VCINSTALLDIR not set, not running in VS Command Prompt
gyp ERR! find VS could not use PowerShell to find Visual Studio 2017 or newer
gyp ERR! find VS looking for Visual Studio 2015
gyp ERR! find VS - not found
gyp ERR! find VS not looking for VS2013 as it is only supported up to Node.js 8
gyp ERR! find VS
gyp ERR! find VS **************************************************************
gyp ERR! find VS You need to install the latest version of Visual Studio
gyp ERR! find VS including the "Desktop development with C++" workload.
gyp ERR! find VS For more information consult the documentation at:
gyp ERR! find VS https://github.com/nodejs/node-gyp#on-windows
gyp ERR! find VS **************************************************************
//more error stuff
I am using atom, and if I could use this without vscode, I would appriciate it.
Visual Studio Code and Visual Studio are, despite the similar name, entirely unrelated products. As mentioned in the error log, you need to install a version of Visual Studio that‘s compatible with node-gyp
(„Visual Studio 2017 or higher“.) The reason for this dependency are the C/C++ compilers included in Visual Studio. The free community edition should be enough to get you going.