node.jsnode-gyp

node-gyp error Could not find any Visual Studio installation to use


The problem that I am having is that I cant install the packages for a project, it keeps erroring with:

npm ERR! npm ERR! gyp ERR! find VS valid versions for msvs_version:
npm ERR! npm ERR! gyp ERR! find VS
npm ERR! npm ERR! gyp ERR! find VS **************************************************************
npm ERR! npm ERR! gyp ERR! find VS You need to install the latest version of Visual Studio
npm ERR! npm ERR! gyp ERR! find VS including the "Desktop development with C++" workload.
npm ERR! npm ERR! gyp ERR! find VS For more information consult the documentation at:
npm ERR! npm ERR! gyp ERR! find VS https://github.com/nodejs/node-gyp#on-windows
npm ERR! npm ERR! gyp ERR! find VS **************************************************************

I have tried to follow advice from these threads that other people had:

How to fix node.js error like "gyp ERR! find VS including the "Desktop development with C++" workload." when I launch Nuxt.js project

And this How can I solve error gypgyp ERR!ERR! find VSfind VS msvs_version not set from command line or npm config?

But neither seemed to help.

What I have done so far:

And I have no idea what else I can do


Solution

  • I found the problem after hours of searching, it was my node version, i was at 16.x.x, I installed node version manager and moved to version 14 and it worked.