2014-07-03 4 views
9

Je suis sur windows 8.1 x64, et j'ai visual studio 2013 ultime. J'ai couru la console comme admin et ne NPM karma -g installer (même avec d'autres modules), et je suis arrivé cette erreur:NPM module installer Visual Studio erreur

NPM WARN option dep a échoué, continue [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], [email protected] 
.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]) 
+0

Je ne vois pas une erreur? On dirait qu'il est bien installé. Il y a un avertissement, mais avez-vous eu des erreurs? – dylants

Répondre

13

Assurez-vous d'avoir tous les logiciels requis pour exécuter node-gyp qui compile le code C++ utilisé par ws (Web Sockets) utilisé par socket.io.

Vous pouvez configurer la version de Visual Studio utilisé par gyp via une variable d'environnement de sorte que vous pouvez éviter d'avoir à définir la propriété --msvs_version=2012.

Exemples:

  • mis GYP_MSVS_VERSION=2012 pour Visual Studio 2012
  • mis GYP_MSVS_VERSION=2013e (le 'e' signifie 'Express Edition')

Pour la liste complète, voir - https://github.com/joyent/node/blob/v0.10.29/tools/gyp/pylib/gyp/MSVSVersion.py#L209-294

Ceci est encore douloureux pour les utilisateurs Windows de NodeJS car il suppose que vous avez une copie de Visual Studi o installé et de nombreux utilisateurs finaux n'auront jamais cela. Je fais donc pression sur Joyent pour les encourager à inclure des sockets Web dans le nœud CORE et aussi pour expédier un compilateur GNU gcc dans le cadre de l'installation de NodeJS afin de pouvoir résoudre définitivement ce problème.

Ne hésitez pas à ajouter votre voix à:

+0

Cela résout également un problème d'installation de fibres. S'ils veulent garder la dépendance VS, ce devrait être la version actuelle. –

+0

Merci. Cela a sauvé mon bacon. Tu gères. +1 –