I want to run this project : https://github.com/adonis-china/adonis-adminify
When I run npm install
, there exist error :
> sqlite3@3
Install all the required tools and configurations using Microsoft's windows-build-tools using npm install --global windows-build-tools
from an elevated PowerShell or CMD.exe (run as Administrator).
Full Guidance in GitHub
Visual Studio Installer -> Modify Installed(Visual Studio Community 2019) -> Workloads(tab) -> [x] Desktop development with C++ -> Install
Use the Visual Studio Installer to get the Desktop development with C++ workload in one of the Visual Studio versions you have installed in your machine:
Reading through the log, the main error is due to this:
msvs_version not set from command line or npm config
After this one you find a few of these:
"Visual Studio C++ core features" missing
And later:
You need to install the latest version of Visual Studio including the "Desktop development with C++" workload.
For more information consult the documentation at:
VS https://github.com/nodejs/node-gyp#on-windows
Finally:
Could not find any Visual Studio installation to use
So to solve the problem, you just need to get "Desktop development with C++" workload.
gyp will then find that version and use it:
gyp info find Python using Python version 3.8.1 found at "C:\Users\USER\AppData\Local\Programs\Python\Python38-32\python.exe"
gyp info find VS using VS2019 (16.4.29709.97) found at:
gyp info find VS "C:\Program Files (x86)\Microsoft Visual Studio\2019\
Disclaimer: I did not test any of these solutions.
As Hamid Jolany's answer suggests, on an admin shell, simply install the build tools package globally (node-gyp README):
npm i -g windows-build-tools
Ragavan's idea/answer for avoiding installing Visual Studio has some logic:
npm config get msvs_version
(if you have, skip to step 4 and attempt setting the environment variables)npm config set msvs_version 2019 --global
(or npm config set msvs_version 2015 --global
according to Ragavan's idea)VCTargetsPath
environment variable (Win + search for var) to the appropriate path (e.g. C:\Program Files (x86)\MSBuild\Microsoft\Portable\v5.0
) or through Run as Admin terminal, as in Ragavan's idea with the 2015 Build Tools:set VCTargetsPath=C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140
$env:VCTargetsPath=C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140
Side notes: