[Fix] gypgyp ERR!ERR! find VSfind VS msvs_version not set from command line or npm config

The error “gypgyp ERR!ERR! find VSfind VS msvs_version not set from command line or npm config” is an error that is invoked whenever you are coding in node.js and trying to import any particular project. Given below is the snippet of the error:

gypgyp ERR!ERR! find VSfind VS msvs_version not set from command line or npm config VCINSTALLDIR not set, not running in VS Command Prompt gyp gypERR! ERR! find VSfind VS VCINSTALLDIR not set, not running in VS Command Prompt gyp ERR! gypfind VS gyp ERR!ERR! find VSfind VS msvs_version not set from command line or npm config npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! sqlite3@3.1.13 install: node-pre-gyp install --fallback-to-build npm ERR! Exit status 1 npm ERR! Failed at the sqlite3@3.1.13 install script in Nodejs

I would like to share with you the steps I took to fix the “gypgyp ERR!ERR! find VSfind VS msvs_version not set from command line or npm config” in your project file.

Why “gypgyp ERR!ERR! find VSfind VS msvs_version not set from command line or npm config” error is seen?

The error, “gypgyp ERR!ERR! find VSfind VS msvs_version not set from command line or npm config” is seen because; you have not installed the latest versions of windows-build-tools, Desktop development with C++ and you must not have installed node-gyp. The error is also caused if you have not Set the msbuild_path.

The detailed solution to fix the error “gypgyp ERR!ERR! find VSfind VS msvs_version not set from command line or npm config”, is given below:

How to fix the error, “gypgyp ERR!ERR! find VSfind VS msvs_version not set from command line or npm config”?

To fix the error, you will have to install the latest versions of windows-build-tools, Desktop development with C++ and install node-gyp. If the error still persists, you can also try to Set msbuild_path.

To fix the error, “gypgyp ERR!ERR! find VSfind VS msvs_version not set from command line or npm config”, follow one of the below-mentioned methods:

Solution 1: Install windows-build-tools

To fix the error, “gypgyp ERR!ERR! find VSfind VS msvs_version not set from command line or npm config”, you will need to run the required tools and configurations using the Microsoft’s windows-build-tools, you will have to run this command on your terminal. Open Your terminal with Administrator Privileges.

npm install --global windows-build-tools

Then you will have to run npm install.

To should fix the error, “gypgyp ERR!ERR! find VSfind VS msvs_version not set from command line or npm config”,

Solution 2: Desktop development with C++

To fix the error, “gypgyp ERR!ERR! find VSfind VS msvs_version not set from command line or npm config”, you will have to install Desktop development with C++ along with your Visual Studio while Installing Visual Studio Community. Please make a note to tick mark the Desktop development with C++ given below in the picture, and then you will have to restart Your PC:

To should fix the error, “gypgyp ERR!ERR! find VSfind VS msvs_version not set from command line or npm config”

Soltion 3: Set msbuild_path

To fix the error, “gypgyp ERR!ERR! find VSfind VS msvs_version not set from command line or npm config”, the executable file named MSBuild.exe which you should be find in the following location C:\Program Files\Microsoft Visual Studio\2022\Community\Msbuild\Current\Bin\MSBuild.exe . Copy Your Full Path and set npm config set msbuild_path with this path, by running the below given command:

npm config set msbuild_path "C:\Program Files\Microsoft Visual Studio\2022\Community\Msbuild\Current\Bin\MSBuild.exe"

To should fix the error, “gypgyp ERR!ERR! find VSfind VS msvs_version not set from command line or npm config”

Solution 4: Install node-gyp

To fix the error, “gypgyp ERR!ERR! find VSfind VS msvs_version not set from command line or npm config”, you will have to install the node-gyp before npm install and run the below mentioned command:

npm install -g node-gyp

Then you will have to run npm install.

npm install

To should fix the error, “gypgyp ERR!ERR! find VSfind VS msvs_version not set from command line or npm config”,

Conclusion

To fix the error “gypgyp ERR!ERR! find VSfind VS msvs_version not set from command line or npm config”, either you will have to install the latest versions of windows-build-tools, Desktop development with C++ and install node-gyp. or If the error still persists, you can also try to Set msbuild_path.