Installing css-sprite reported an error.

  node.js, question

npm install css-spriteReport an error
nodeThe version of isv0.10.34
Global installation is also not good.
图片描述

Node-gyp requires Visual Studio to compile some dependencies.

ReferencesMooc discussion

# Cause
Before version 1.3.15 of npm, node-gyp will call VCBuild.exe at compile time. VCBuild.exe cannot be found under vs2012. VS 2012 and later versions use msbuild.exe as compiler.

# Resolve
Set the compiler of msvs of npm to vs2012
Cmd execution:
npm config set msvs_version 2012 –global


In fact, css-sprites has many replaceable plug-ins, for example, we are using it.glue. Sprite plug-ins useThe same algorithmTherefore, these plug-ins are only used in different ways, and the way of embedding workflow is different.

Glue is written in python. The things that depend on in windows environment are relatively simple and do not need to be compiled. Glue is not released to npm. As a python tool, Glue is managed through pip and requires an installation process different from npm. SeeInstallation guide.