There is a error when I want to run `node-gyp rebuild` - node-gyp

Environment:Windows10 x64, nodejs v8.15.0 python:2.7.6
I want to rebuild my code, and the last step is node-gyp rebuild.
I get an error:
MSBUILD : error MSB3428: Failed to load Visual C++ component “VCBuild.exe”。To fix this,1) Install .NET Framework 2.0 SDK;2) Install Microsoft Visual Studio 2005;or 3) If the component is installed in a different location, add its location to the system path. [C:\Other Soft\AMO-Tools-Suite-develop\build\binding.sln]
MSBUILD : error MSB3428: Failed to load Visual C++ component “VCBuild.exe”。To fix this,1) Install .NET Framework 2.0 SDK;2) Install Microsoft Visual Studio 2005;or 3) If the component is installed in a different location, add its location to the system path. [C:\Other Soft\AMO-Tools-Suite-develop\build\binding.sln]
MSBUILD : error MSB3428: Failed to load Visual C++ component “VCBuild.exe”。To fix this,1) Install .NET Framework 2.0 SDK;2) Install Microsoft Visual Studio 2005;or 3) If the component is installed in a different location, add its location to the system path. [C:\Other Soft\AMO-Tools-Suite-develop\build\binding.sln]
MSBUILD : error MSB3428: Failed to load Visual C++ component “VCBuild.exe”。To fix this,1) Install .NET Framework 2.0 SDK;2) Install Microsoft Visual Studio 2005;or 3) If the component is installed in a different location, add its location to the system path. [C:\Other Soft\AMO-Tools-Suite-develop\build\binding.sln]
MSBUILD : error MSB3428: Failed to load Visual C++ component “VCBuild.exe”。To fix this,1) Install .NET Framework 2.0 SDK;2) Install Microsoft Visual Studio 2005;or 3) If the component is installed in a different location, add its location to the system path. [C:\Other Soft\AMO-Tools-Suite-develop\build\binding.sln]
MSBUILD : error MSB3428: Failed to load Visual C++ component “VCBuild.exe”。To fix this,1) Install .NET Framework 2.0 SDK;2) Install Microsoft Visual Studio 2005;or 3) If the component is installed in a different location, add its location to the system path. [C:\Other Soft\AMO-Tools-Suite-develop\build\binding.sln]
gyp ERR! build error
gyp ERR! stack Error: `C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe` failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Users\18363\AppData\Roaming\npm\node_modules\node-gyp\lib\build.js:262:23)
gyp ERR! stack at emitTwo (events.js:126:13)
gyp ERR! stack at ChildProcess.emit (events.js:214:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Windows_NT 10.0.17134
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\18363\\AppData\\Roaming\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Other Soft\AMO-Tools-Suite-develop
gyp ERR! node -v v8.15.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
I tried to fix it with:
npm config set msvs_version 2017 -global
and:
npm install -global -production windows-build-tools
But it didn't work.

g++ gcc libgcc libstdc++
You shall install above tools.

Related

Gatsby project creation error . Error: Could not find any Visual Studio installation to use

I have visual studio code 2017 installed on my system
and I am facing these error in gatsby new project created through cli command
gatsby new
Below is the error
gatsby new
create-gatsby version 2.2.0
Welcome to Gatsby!
This command will generate a new Gatsby site for you in E:\GATSBY with the setup you select. Let's answer some
questions:
What would you like to call your site?
√ · My Gatsby Site
What would you like to name the folder where your site will be created?
√ GATSBY/ my-gatsby-site
√ Will you be using a CMS?
· No (or I'll add it later)
√ Would you like to install a styling system?
· No (or I'll add it later)
Thanks! Here's what we'll now do:
Create a new Gatsby site in the folder my-gatsby-site
√ Created site from template
> Installing Gatsby...
gyp ERR! find VS
gyp ERR! find VS msvs_version was set from command line or npm config
gyp ERR! find VS - looking for Visual Studio version 2015
gyp ERR! find VS VCINSTALLDIR not set, not running in VS Command Prompt
gyp ERR! find VS checking VS2017 (15.9.28307.1745) found at:
gyp ERR! find VS "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community"
gyp ERR! find VS - found "Visual Studio C++ core features"
gyp ERR! find VS - found VC++ toolset: v141
gyp ERR! find VS - found Windows SDK: 10.0.17763.0
gyp ERR! find VS - msvs_version does not match this version
gyp ERR! find VS checking VS2017 (15.9.28307.1525) found at:
gyp ERR! find VS "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools"
gyp ERR! find VS - found "Visual Studio C++ core features"
gyp ERR! find VS - found VC++ toolset: v141
gyp ERR! find VS - found Windows SDK: 10.0.17763.0
gyp ERR! find VS - msvs_version does not match this version
gyp ERR! find VS could not find a version of Visual Studio 2017 or newer to use
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 valid versions for msvs_version:
gyp ERR! find VS - "2017"
gyp ERR! find VS - "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community"
gyp ERR! find VS - "2017"
gyp ERR! find VS - "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools"
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 **************************************************************
gyp ERR! find VS
gyp ERR! configure error
gyp ERR! stack Error: Could not find any Visual Studio installation to use
gyp ERR! stack at VisualStudioFinder.fail (C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:121:47)
gyp ERR! stack at C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:74:16
gyp ERR! stack at VisualStudioFinder.findVisualStudio2013 (C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:351:14)
gyp ERR! stack at C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:70:14
gyp ERR! stack at C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:372:16
gyp ERR! stack at C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\node-gyp\lib\util.js:54:7
gyp ERR! stack at C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\node-gyp\lib\util.js:33:16
gyp ERR! stack at ChildProcess.exithandler (child_process.js:326:5)
gyp ERR! stack at ChildProcess.emit (events.js:376:20)
gyp ERR! stack at maybeClose (internal/child_process.js:1055:16)
gyp ERR! System Windows_NT 10.0.19043
gyp ERR! command "C:\\Program Files (x86)\\nodejs\\node.exe" "C:\\Program Files (x86)\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd E:\GATSBY\my-gatsby-site\node_modules\msgpackr-extract
gyp ERR! node -v v14.17.0
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
gyp ERR! find VS
gyp ERR! find VS msvs_version was set from command line or npm config
gyp ERR! find VS - looking for Visual Studio version 2015
gyp ERR! find VS VCINSTALLDIR not set, not running in VS Command Prompt
gyp ERR! find VS checking VS2017 (15.9.28307.1745) found at:
gyp ERR! find VS "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community"
gyp ERR! find VS - found "Visual Studio C++ core features"
gyp ERR! find VS - found VC++ toolset: v141
gyp ERR! find VS - found Windows SDK: 10.0.17763.0
gyp ERR! find VS - msvs_version does not match this version
gyp ERR! find VS checking VS2017 (15.9.28307.1525) found at:
gyp ERR! find VS "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools"
gyp ERR! find VS - found "Visual Studio C++ core features"
gyp ERR! find VS - found VC++ toolset: v141
gyp ERR! find VS - found Windows SDK: 10.0.17763.0
gyp ERR! find VS - msvs_version does not match this version
gyp ERR! find VS could not find a version of Visual Studio 2017 or newer to use
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 valid versions for msvs_version:
gyp ERR! find VS - "2017"
gyp ERR! find VS - "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community"
gyp ERR! find VS - "2017"
gyp ERR! find VS - "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools"
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 **************************************************************
gyp ERR! find VS
gyp ERR! configure error
gyp ERR! stack Error: Could not find any Visual Studio installation to use
gyp ERR! stack at VisualStudioFinder.fail (C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:121:47)
gyp ERR! stack at C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:74:16
gyp ERR! stack at VisualStudioFinder.findVisualStudio2013 (C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:351:14)
gyp ERR! stack at C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:70:14
gyp ERR! stack at C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:372:16
gyp ERR! stack at C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\node-gyp\lib\util.js:54:7
gyp ERR! stack at C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\node-gyp\lib\util.js:33:16
gyp ERR! stack at ChildProcess.exithandler (child_process.js:326:5)
gyp ERR! stack at ChildProcess.emit (events.js:376:20)
gyp ERR! stack at maybeClose (internal/child_process.js:1055:16)
gyp ERR! System Windows_NT 10.0.19043
gyp ERR! command "C:\\Program Files (x86)\\nodejs\\node.exe" "C:\\Program Files (x86)\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd E:\GATSBY\my-gatsby-site\node_modules\lmdb-store
gyp ERR! node -v v14.17.0
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! lmdb-store#1.6.13 install: `node-gyp-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the lmdb-store#1.6.13 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
ERROR
Command failed with exit code 1: npm install --loglevel error --color always
> msgpackr-extract#1.0.15 install E:\GATSBY\my-gatsby-site\node_modules\msgpackr-extract
> node-gyp-build
E:\GATSBY\my-gatsby-site\node_modules\msgpackr-extract>if not defined npm_config_node_gyp (node "C:\Program Files
(x86)\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js"
rebuild ) else (node "C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
> lmdb-store#1.6.13 install E:\GATSBY\my-gatsby-site\node_modules\lmdb-store
> node-gyp-build
E:\GATSBY\my-gatsby-site\node_modules\lmdb-store>if not defined npm_config_node_gyp (node "C:\Program Files
(x86)\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js"
rebuild ) else (node "C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
EDIT:
Error
npm install --global windows-build-tools --vs2015 npm WARN deprecated request#2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated har-validator#5.1.5: this library is no longer supported
> windows-build-tools#5.2.2 postinstall C:\Users\farih\AppData\Roaming\npm\node_modules\windows-build-tools
> node ./dist/index.js
Downloading python-2.7.15.msi
[> ] 0.0% (0 B/s)
Downloaded python-2.7.15.msi. Saved to C:\Users\farih\.windows-build-tools\python-2.7.15.msi.
Downloading BuildTools_Full.exe
[> ] 0.0% (0 B/s)
Downloaded BuildTools_Full.exe. Saved to C:\Users\farih\.windows-build-tools\BuildTools_Full.exe.
Starting installation...
Launched installers, now waiting for them to finish.
This will likely take some time - please be patient!
Status from the installers:
---------- Visual Studio Build Tools ----------
[3C84:46EC][2021-11-26T00:41:36]i000: Setting string variable 'LastGoodSource' to value 'Web'
[3C84:46EC][2021-11-26T00:41:36]i000: Setting string variable 'IsWebBundle' to value 'True'
[3C84:46EC][2021-11-26T00:41:36]i000: MUX: Ux Uninitialized
[3C84:46EC][2021-11-26T00:41:36]i000: MUX: Exit with 0x643 (Failed)
[3C84:1114][2021-11-26T00:41:36]i500: Shutting down, exit code: 0x643
------------------- Python --------------------
Successfully installed Python 2.7
Could not install Visual Studio Build Tools.
Please find more details in the log files, which can be found at
C:\Users\farih\.windows-build-tools
Now configuring Python...
All done!
+ windows-build-tools#5.2.2
added 148 packages from 102 contributors in 380.326s
My Problem is msvs version not set as it says in the error msvs_version does not match this version
I run
npm install --global windows-build-tools --vs2017
npm config set msvs_version 2017.
Refer the docs here

yarn - installation of deasync fails

When I create a react app on Windows with node 15 like this:
yarn create react-app my-project --template typescript
It fails with
yarn create v1.22.11
[1/4] Resolving packages...
[2/4] Fetching packages...
info fsevents#1.2.9: The platform "win32" is incompatible with this module.
info "fsevents#1.2.9" is an optional dependency and failed compatibility check. Excluding it from installation.
info fsevents#2.0.6: The platform "win32" is incompatible with this module.
info "fsevents#2.0.6" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
[4/4] Building fresh packages...
[-/4] ⠁ waiting...
[-/4] ⠁ waiting...
[3/4] ⠂ deasync
error C:\Users\teyc\AppData\Local\Yarn\Data\global\node_modules\deasync: Command failed.
Exit code: 1
Command: node ./build.js
Arguments:
Directory: C:\Users\teyc\AppData\Local\Yarn\Data\global\node_modules\deasync
Output:
C:\Users\teyc\AppData\Local\Yarn\Data\global\node_modules\deasync>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "" rebuild )
gyp info it worked if it ends with ok
gyp info using node-gyp#7.1.2
gyp info using node#15.0.1 | win32 | x64
gyp info find Python using Python version 3.7.3 found at "C:\Users\teyc\AppData\Local\Programs\Python\Python37-32\python.exe"
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 checking VS2019 (16.8.30717.126) found at:
I don't want to install compilers. Are there binaries available for downloading?
Unfortunately, the deasync node package might not contain every binary for your node version and operating system, and yarn for some inexplicable reason requires it when running create react-app while npx doesn't.
Your options are:
Figure out how to download the prebuilt binaries into your system
https://github.com/abbr/deasync-bin
use npx
npx create react-app my-project --template typescript
use yarn 2. This is the method I prefer as it consumes less disk space
yarn set version berry
yarn create react-app myproject --template typescript

gyp ERR! while rebuilding with electron-rebuild

I have been stuck with this error since the past 2 days. Any help will be appreciated. I am trying to rebuild the app to use serialport npm package.
Node version: 14.16.1.
I want to work with the package serialport alongside electron with react. But when I run the command .\node_modules.bin\electron-rebuild.cmd, I get the following error:
⠹ Building module: bindings, Completed: 0Attempting to build a module with a space in the path
See https://github.com/nodejs/node-gyp/issues/65#issuecomment-368820565 for reasons why this may not work
⠴ Building module: bindings, Completed: 0gyp info find Python using Python version 3.9.4 found at "C:\Users\Family\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\python.exe"
⠙ Building module: bindings, Completed: 0gyp ERR! find VS
gyp ERR! find VS msvs_version was set from command line or npm config
gyp ERR! find VS - looking for Visual Studio version 2015
gyp ERR! find VS VCINSTALLDIR not set, not running in VS Command Prompt
gyp ERR! find VS checking VS2019 (16.9.31205.134) found at:
gyp ERR! find VS "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community"
gyp ERR! find VS - found "Visual Studio C++ core features"
gyp ERR! find VS - found VC++ toolset: v142
gyp ERR! find VS - found Windows SDK: 10.0.19041.0
gyp ERR! find VS - msvs_version does not match this version
gyp ERR! find VS checking VS2017 (15.9.28307.1500) found at:
gyp ERR! find VS "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools"
gyp ERR! find VS - found "Visual Studio C++ core features"
gyp ERR! find VS - found VC++ toolset: v141
gyp ERR! find VS - found Windows SDK: 10.0.17763.0
gyp ERR! find VS - msvs_version does not match this version
gyp ERR! find VS could not find a version of Visual Studio 2017 or newer to use
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 valid versions for msvs_version:
gyp ERR! find VS - "2019"
gyp ERR! find VS - "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community"
gyp ERR! find VS - "2017"
gyp ERR! find VS - "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools"
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 **************************************************************
gyp ERR! find VS
✖ Rebuild Failed
An unhandled error occurred inside electron-rebuild
node-gyp failed to rebuild 'C:\MERN Work\Electron Apps\React_Only\simple-electron-react\node_modules\#serialport\bindings'.
Error: Could not find any Visual Studio installation to use
Error: node-gyp failed to rebuild 'C:\MERN Work\Electron Apps\React_Only\simple-electron-react\node_modules\#serialport\bindings'.
Error: Could not find any Visual Studio installation to use
at ModuleRebuilder.rebuildNodeGypModule (C:\MERN Work\Electron Apps\React_Only\simple-electron-react\node_modules\electron-rebuild\lib\src\module-rebuilder.js:193:19)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async Rebuilder.rebuildModuleAt (C:\MERN Work\Electron Apps\React_Only\simple-electron-react\node_modules\electron-rebuild\lib\src\rebuild.js:190:9)
at async Rebuilder.rebuild (C:\MERN Work\Electron Apps\React_Only\simple-electron-react\node_modules\electron-rebuild\lib\src\rebuild.js:152:17)
at async C:\MERN Work\Electron Apps\React_Only\simple-electron-react\node_modules\electron-rebuild\lib\src\cli.js:146:9
Btw I have had installed the microsoft build tools both manually and using npm command : npm install --global windows-build-tools. Here's what I installed manually via .exe:
Been using this https://github.com/bradtraversy/simple-electron-react boilerplate.
Following these steps solved the issue for me :
Install the latest Visual Studio toolkit and visual-studio-installer.
Install node-gyp globally with admin privileges.
Install electron-builder#22.11.1
Specifications :
Windows 10 , Electron :13.0.0 , node : v14.16.1 , yarn : 1.22.10 , electron-react-boilerplate

Installing Karma failed

Tried to install Karma
npm install -g karma
A warning is produced
npm WARN optional dep failed, continuing fsevents#0.3.5
At the end it seems there is no Karma installed
karma init karma.config.js
'karma' is not recognized as an internal or external command (so a windows installation).
However there seems to be a karma in
C:\Users\Me\AppData\Roaming\npm\node_modules\karma
and a builerror.log file
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
gyp ERR! stack at failNoPython (c:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:103:14)
gyp ERR! stack at c:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:64:11
gyp ERR! stack at Object.oncomplete (evalmachine.<anonymous>:108:15)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "node" "c:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\Me\AppData\Roaming\npm\node_modules\karma\node_modules\socket.io\node_modules\socket.io-client\node_modules\ws
gyp ERR! node -v v0.10.36
gyp ERR! node-gyp -v v1.0.1
gyp ERR! not ok
Do I need to install python in order to work with karma or is something else wrong? Thanks in advance for any help!
You need to install the command line interface so that karma will be recognised:
npm install -g karma-cli
Karma Installaltion Guide
The node-gyp error is because python isn't installed. To avoid that error follow the following steps:
Install python (v2.7.10 recommended, v3.x.x is not supported): http://www.python.org/getit/windows/
Make sure that you have a PYTHON environment variable, and it is set to drive:\path\to\python.exe not to a folder
Install Visual Studio
Windows XP/Vista/7:
- Microsoft Visual Studio C++ 2013 (Express version works well)
- If the install fails, try uninstalling any C++ 2010 x64&x86
Redistributable that you have installed first
- If you get errors that the 64-bit compilers are not installed you may
also need the compiler update for the Windows SDK 7.1
Windows 7/8:
- Microsoft Visual Studio C++ 2013 for Windows Desktop (Express version
works well)
Windows 10:
- Install Visual Studio Community 2015 Edition. (Custom Install, Select
Visual C++ during the installation)
- Set the environment variable GYP_MSVS_VERSION=2015
- Run the command prompt as Administrator
If the above steps have not worked or you are unsure please visit http://www.serverpals.com/blog/building-using-node-gyp-with-visual-studio-express-2015-on-windows-10-pro-x64 for a full walkthrough
All Windows Versions
- For 64-bit builds of node and native modules you will also need the
Windows 7 64-bit SDK
You may need to run one of the following commands if your build complains about WindowsSDKDir not being set, and you are sure you have already installed the SDK:
call "C:\Program Files\Microsoft SDKs\Windows\v7.1\bin\Setenv.cmd" /Release /x86
call "C:\Program Files\Microsoft SDKs\Windows\v7.1\bin\Setenv.cmd" /Release /x64
Source: node-gyp Github
Reference from https://stackoverflow.com/a/21366601/368997.
Karma requies node-gyp, and node-gyp has its own dependence (from the github).
Especially Windows, you need python and make sure that you have a PYTHON environment variable.

node-gyp troubles with installation

I'm trying to install webworker-threads, a node addon that requires gyp. I followed the gyp instructions for setup, so far I'm still getting an error when trying to "rebuild":
C:\Program Files\nodejs\node_modules\webworker-threads>node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\....\node_modules\node-gyp\bin\node-gyp.js" rebuild
gyp ERR! configure error
gyp ERR! stack Error: spawn ENOENT
gyp ERR! stack at errnoException (child_process.js:980:11)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:771:34)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "node" "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Program Files\nodejs\node_modules\webworker-threads
gyp ERR! node -v v0.10.8
gyp ERR! node-gyp -v v0.9.5
gyp ERR! not ok
npm ERR! weird error 1
npm ERR! not ok code 0
I'm on a Windows 7 32 bit system.
Sooo to spare some time here's my personal checklist:
Paths: node is in both user and system path. npm is in user path. Python path is set too.
Python: 2.7.3 installed at C:\Python27
VisualStudio C++ 2010 AND 2012 Express installed
node version v0.10.8
ran everything with administrator privileges
Commands executed: npm install -g node-gyp
npm install webworker-threads
Then the error appears.
Do you guys by any chance notice something I'm doing wrong?
Thanks a lot in advance for your guidance!
try npm install –msvs_version=2012. This command will ask NPM to use visual studio 2012 to build.
http://www.kevgriffin.com/specifying-visual-studio-version-in-npm-installs/
After spending a while to get this to work (for me accepted answer didn't work, for me it's just half solution) i did following:
Sadly, you must have visual studio (i installed express edition 2013 for DESKTOP)
Installed python 2.7.3 (you don't have to set any environment variables)
Run cmd as administrator and go to you project root (where is you package.json file)
First run: npm config set python C:\Python27\python.exe
Then: npm install -msvs_version=2013
The trick is in command npm config set python ...path_to_python_exe... which will be provided by npm to dependency which needs python i guess.
Got Windows 7 64 bit.
Did all the above but I still got the error which was mentioned.
What worked for me was:
Uninstall Microsoft .NET Frameworks (I got more than one version)
Open regedit and navigating to:
hkey_local_machine/software/Microsoft/MSBuild
Remove all .net versions (I got there 2 and 3.5 sub directories)
If You have OS 64 Bit repeat steps 2 & 3 for %WinDir%\SysWOW64\regedit.exe
Reinstall Microsoft .NET Framework
Hope it will spare some time for you.

Resources