node.js - 安装css-sprite报错
高洛峰
高洛峰 2017-04-17 11:42:39
0
1
583

npm install css-sprite报错
node的版本为v0.10.34
全局安装也不行。

高洛峰
高洛峰

拥有18年软件开发和IT教学经验。曾任多家上市公司技术总监、架构师、项目经理、高级软件工程师等职务。 网络人气名人讲师,...

reply all(1)
巴扎黑

node-gyp requires Visual Studio to be installed to compile some dependencies.

Refer to the mooc discussion:

#reason
Before npm version 1.3.15, node-gyp would call VCBuild.exe when compiling. VCBuild.exe cannot be found under vs2012. In vs2012 and later versions, msbuild.exe is used as the compiler.

#solve
Set npm's msvs compiler to vs2012
cmd execution:
npm config set msvs_version 2012 --global


In fact, there are many alternative plug-ins for css-sprites, such as we are using glue. The sprite plug-ins all use the same algorithm, so these plug-ins are just different in the way they are used and embedded in the workflow.

Glue is written in python. The dependencies in the windows environment are relatively simple and do not require compilation. Glue is not released to npm. As a python tool, it is managed through pip and requires a different installation process from npm. See the installation guide.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template