Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Npm module install visual studio error

Tags:

node.js

I am on windows 8.1 x64, and i have visual studio 2013 ultimate. I ran console as admin and did npm install -g karma (same with other modules), and i got this error:

npm WARN optional dep failed, continuing [email protected] /

[email protected] install C:\Program Files (x86)\nodejs\node_modules\karma\node_module s\socket.io\node_modules\socket.io-client\node_modules\ws (node-gyp rebuild 2> builderror.log) || (exit 0)

C:\Program Files (x86)\nodejs\node_modules\karma\node_modules\socket.io\node_mod
ules\socket.io-client\node_modules\ws>node "C:\Users\Filip\AppData\Roaming\npm\n
ode_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" r
ebuild
Building the projects in this solution one at a time. To enable parallel build,
please add the "/m" switch.
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.Cpp.Platform.t
argets(64,5): error MSB8020: The build tools for Visual Studio 2010 (Platform T
oolset = 'v100') cannot be found. To build using the v100 build tools, please i
nstall Visual Studio 2010 build tools.  Alternatively, you may upgrade to the c
urrent Visual Studio tools by selecting the Project menu or right-click the sol
ution, and then selecting "Upgrade Solution...". [C:\Program Files (x86)\nodejs
\node_modules\karma\node_modules\socket.io\node_modules\socket.io-client\node_m
odules\ws\build\bufferutil.vcxproj]
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.Cpp.Platform.t
argets(64,5): error MSB8020: The build tools for Visual Studio 2010 (Platform T
oolset = 'v100') cannot be found. To build using the v100 build tools, please i
nstall Visual Studio 2010 build tools.  Alternatively, you may upgrade to the c
urrent Visual Studio tools by selecting the Project menu or right-click the sol
ution, and then selecting "Upgrade Solution...". [C:\Program Files (x86)\nodejs
\node_modules\karma\node_modules\socket.io\node_modules\socket.io-client\node_m
odules\ws\build\validation.vcxproj]
[email protected] C:\Program Files (x86)\nodejs\node_modules\karma
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected] ([email protected])
├── [email protected] ([email protected], [email protected])
├── [email protected] ([email protected], [email protected])
├── [email protected] ([email protected])
├── [email protected] ([email protected], [email protected])
├── [email protected]
├── [email protected] ([email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected])
├── [email protected] ([email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected]
.0, [email protected], [email protected], [email protected], [email protected], [email protected], batch@0
.5.0, [email protected], [email protected], [email protected], [email protected], [email protected]
.0)
└── [email protected] ([email protected], [email protected], [email protected], socket.io-c
[email protected])
like image 412
Case09 Avatar asked Jul 03 '14 06:07

Case09


People also ask

Why is npm install failing?

code 1 error usually occurs when you run the npm install command. This cause of this error is that one of the dependencies you define in your package. json file fails to be installed properly on your computer. This means that npm fails to install the node-sass module that's added as a dependency to the n-app project.


1 Answers

Make sure you have all the required software to run node-gyp that compiles C++ code used by ws (Web Sockets) that's used by socket.io.

  • https://github.com/TooTallNate/node-gyp

You can configure version of Visual Studio used by gyp via an environment variable so you can avoid having to set the --msvs_version=2012 property.

Examples:

  • set GYP_MSVS_VERSION=2012 for Visual Studio 2012
  • set GYP_MSVS_VERSION=2013e (the 'e' stands for 'express edition')

For the full list see - https://github.com/joyent/node/blob/v0.10.29/tools/gyp/pylib/gyp/MSVSVersion.py#L209-294

This is still painful for Windows users of NodeJS as it assumes you have a copy of Visual Studio installed and many end users will never have this. So I'm lobbying Joyent to encourage them to include web sockets as part of CORE node and also to possible ship a GNU gcc compiler as part of NodeJS install so we can permanently fix this problem.

Feel free to add your vote at:

  • https://github.com/joyent/node/issues/8005#issuecomment-50545326
like image 165
Tony O'Hagan Avatar answered Sep 23 '22 20:09

Tony O'Hagan