search

Home  >  Q&A  >  body text

node.js - 安装css-sprite报错

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

高洛峰高洛峰2781 days ago580

reply all(1)I'll reply

  • 巴扎黑

    巴扎黑2017-04-17 11:44:39

    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.

    reply
    0
  • Cancelreply