在 Windows 7 上,某些软件包(sqlite3、socket.io)的 npm 安装失败并出现错误 MSB8020

npm install for some packages (sqlite3, socket.io) fail with error MSB8020 on Windows 7(在 Windows 7 上,某些软件包(sqlite3、socket.io)的 npm 安装失败并出现错误 MSB8020)
本文介绍了在 Windows 7 上,某些软件包(sqlite3、socket.io)的 npm 安装失败并出现错误 MSB8020的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在装有 Visual Studio 2012(而不是 2010)的 Windows 7 机器上尝试使用 npm install socket.io 安装一些 node.js 包(特别是 sqlite3 和 socket.io)时,我有一些看起来像这样的失败:

When trying to install some node.js packages (sqlite3 and socket.io in particular) using npm install socket.io on my Windows 7 machine with Visual Studio 2012 (and not 2010) I had some failures that looked like this:

C:程序文件(x86)MSBuildMicrosoft.Cppv4.0V110Microsoft.Cpp.Platform.targets(35,5):错误 MSB8020:Visual Studio 2010(平台)的构建工具找不到工具集 = 'v100').使用 v100 构建工具,单击项目"菜单或右键单击解决方案,然后然后选择更新 VC++ 项目...".安装 Visual Studio 2010使用 Visual Studio 2010 构建工具构建.

C:Program Files (x86)MSBuildMicrosoft.Cppv4.0V110Microsoft.Cpp.Platform.targets(35,5): error MSB8020: The builds tools for Visual Studio 2010 (Platform Toolset = 'v100') cannot be found. To build using the v100 build tools, either click the Project menu or right-click the solution, and then select "Update VC++ Projects...". Install Visual Studio 2010 to build using the Visual Studio 2010 build tools.

推荐答案

为了在我的机器上解决这个问题,我执行了以下命令来安装软件包:

To get around this on my machine I did this command to install the package:

npm install socket.io --msvs_version=2012

我在这里找到了答案,当安装 sqlite3 时遇到问题并且它与 socket.io 一起工作

I found the answer here when having the problem with installing sqlite3 and it worked with socket.io as well.

这些可能是解决问题的更持久的解决方案:

These might be more permanent solutions to fix the problem:

  1. 安装 Visual Studio 2010
  2. 按照此处和这里(可能是更好的选择,虽然我没有让它工作但没有尝试太久)
  1. Install Visual Studio 2010
  2. Updating the npm internal copy to a newer version of node-gyp as described here and here (probably the better option although I didn't get it working but didn't try for too long)

这篇关于在 Windows 7 上,某些软件包(sqlite3、socket.io)的 npm 安装失败并出现错误 MSB8020的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

Bulk insert with mysql2 and NodeJs throws 500(使用mysql2和NodeJS的大容量插入抛出500)
FastAPI + Tortoise ORM + FastAPI Users (Python) - Relationship - Many To Many(FastAPI+Tortoise ORM+FastAPI用户(Python)-关系-多对多)
How to get insertId for MySQL using Mysql2 in Node with async and pool?(如何在带异步和池的Node中使用Mysql2获取MySQL的InsertID?)
How to make node.js mysql connection pooling available on startup(如何使node.js MySQL连接池在启动时可用)
Window functions not working in pd.read_sql; Its shows error(窗口函数在pd.read_sql中不起作用;它显示错误)
(Closed) Leaflet.js: How I can Do Editing Geometry On Specific Object I Select Only?((已关闭)Leaflet.js:如何仅在我选择的特定对象上编辑几何图形?)