我安装了 Visual Studio Express 2013 和 Visual Studio Community 2015。
我得到
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.Cpp.Platform.targets(64,5): error MSB8020: The build tools for v140 (Platform Toolset = 'v140') cannot be found. To build using the v140 build tools, please install v140 build tools. Alternatively, you may upgrade to the current Visual Studio tools by selecting the Project menu or right-click the solution, and then selecting "Upgrade Solution...". [G:\work\cinema\node_modules\engine.io\node_modules\bufferutil\build\bufferutil.vcxproj]
原因是从https://nodejs.org下载的适用于 Windows 的最新 Node.js包含旧的npm
v2(并且node-gyp
在该npm
v2 中是旧的)。
我不得不更新 Node.js 的内部npm
(也更新了node-gyp
):
(open console as an administrator)
cd "C:\Program Files\nodejs"
npm install npm@latest
npm config set msvs_version 2013
现在它可以工作了(似乎它暂时使用的是VS 2013)