npm install fails on Windows when better-sqlite3 is in the package.json

625 Views Asked by At

When executing "npm install" for my node application, I suddenly started getting the error:

Could not load the Visual C++ component "VCBuild.exe"

enter image description here

I have narrowed it down to the following line in the package.json file under dependencies:

"better-sqlite3": "^4.1.4",

What do I need to do or install so that I can load better-sqlite3 with npm on this Windows 10 64-bit machine?

Addendum:

  1. I tried npm install -g windows-build-tools as administrator, but got the error:

Could not install Visual Studio Build Tools.

enter image description here

  1. I have Visual Studio 2017 Community Edition installed on this computer.

  2. I have npm version 6.4.1.

  3. Interestingly, a similar error occurs during npm install on linux, which can be avoided by removing the "better-sqlite3": "^4.1.4" line out of the package.json file:

enter image description here

0

There are 0 best solutions below