Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
504 views
in Technique[技术] by (71.8m points)

node.js - npm install for some packages (sqlite3, socket.io) fail with error MSB8020 on Windows 7

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: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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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

npm install socket.io --msvs_version=2012

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. 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)

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...