错误MSB8007,同时下载与npm和节点的依赖关系

我正在尝试在npm节点应用程序中安装一些软件包,并且不断收到下面的错误消息。 我得到了与socket.io和mongo相同的错误。 我已经经历了许多类似的错误,并且根据其他线程中的build议安装了很多不同的东西,我真的不知道问题是什么。 如果有人有什么build议,我需要下载/设置,我将不胜感激。

$ npm install mongodb npm http GET https://registry.npmjs.org/mongodb npm http 304 https://registry.npmjs.org/mongodb npm http GET https://registry.npmjs.org/bson/0.1.9 npm http GET https://registry.npmjs.org/kerberos npm http 304 https://registry.npmjs.org/bson/0.1.9 npm http 304 https://registry.npmjs.org/kerberos > kerberos@0.0.2 install c:\Users\Ludicritz\Desktop\Umass-running-app\node_modules\mongodb\node_modules\kerberos > (node-gyp rebuild 2> builderror.log) || (exit 0) c:\Users\Ludicritz\Desktop\Umass-running-app\node_modules\mongodb\node_modules\kerberos>node "c:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bi n\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild > bson@0.1.9 install c:\Users\Ludicritz\Desktop\Umass-running-app\node_modules\mongodb\node_modules\bson > (node-gyp rebuild 2> builderror.log) || (exit 0) c:\Users\Ludicritz\Desktop\Umass-running-app\node_modules\mongodb\node_modules\bson>node "c:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\. .\..\node_modules\node-gyp\bin\node-gyp.js" rebuild C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.Cpp.InvalidPlatform.Targets(23,7): error MSB8007: The Platform for project 'kerberos.vcxp roj' is invalid. Platform='x64'. You may be seeing this message because you are trying to build a project without a solution file, and have specifie da non-default Platform that doesn't exist for this project. [c:\Users\Ludicritz\Desktop\Umass-running-app\node_modules\mongodb\node_modules\kerbero s\build\kerberos.vcxproj] C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.Cpp.InvalidPlatform.Targets(23,7): error MSB8007: The Platform for project 'bson.vcxproj' is invalid. Platform='x64'. You may be seeing this message because you are trying to build a project without a solution file, and have specified a non-default Platform that doesn't exist for this project. [c:\Users\Ludicritz\Desktop\Umass-running-app\node_modules\mongodb\node_modules\bson\build\ bson.vcxproj] mongodb@1.3.9 node_modules\mongodb ├── kerberos@0.0.2 └── bson@0.1.9 

VS C ++ Express 2010 32位是免费的。 如果安装了nodejs的64位版本,只需将其删除并安装node.js的32位版本即可

我有一个微妙的问题,这是我的解决scheme。 我正在运行Windows 7 x64。 我安装了nodejs的x64版本。 我试图运行安装,这就是我得到的:

起初它要我把我的道路,我做的。 那么它要我安装python(而不是3.xx版本,但2.xx),并把它放在我的path,我做了。 然后,我安装了Visual Studio 2010(c ++)。 我做了所有这一切后,我得到这个错误:

D:\ Source \ xxxx \ grunt-raptr \ node_modules \ node_modules \ libxmljs \ build \ vendor \ libxml \ libxml.vcxproj(18,3):error MSB4019:The imported project“D:\ Microsoft.Cpp.Default.props”没find。 确认声明中的path是正确的,并且该文件存在于磁盘上。

我读过的地方,如果你在Visual Studio cmd中运行它,你可以使它工作,我试过了,我得到这个错误:

C:\ Program Files(x86)\ MSBuild \ Microsoft.Cpp \ v4.0 \ Microsoft.Cpp.InvalidPlatform.Targets(23,7):错误MSB8007:项目“libxml.vcxproj”的平台无效。 平台=“64”。 您可能会看到此消息,因为您正在尝试构build一个没有解决scheme文件的项目,并且已经为此项目指定了一个不存在的非默认平台。 [d:\源\ XXXX \ node_modules \咕噜-raptr \ node_modules \ libxmljs \build立\厂商\的libxml \的libxml。 vcxproj]

一旦我看到这个,我重新安装nodejs的x32版本,一切工作。

我希望这可以帮助别人。

在尝试安装节点检查器时: C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.Cpp.InvalidPlatform.Targets(23,7): error MSB8007: The Platform for project 'bufferutil.vcxproj' is invalid. Platform='x64' C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.Cpp.InvalidPlatform.Targets(23,7): error MSB8007: The Platform for project 'bufferutil.vcxproj' is invalid. Platform='x64'

我的机器:

  • Win 7 64bit
  • 节点0.12.7 64位
  • Python 2.7 64位

我如何使用网上find的所有build议来解决这个问题:

  • 卸载所有的VC ++ 20xx Redistributable
    • (如果卸载失败,请使用此MS FixIt )
  • 安装Windows 7的Microsoft Windows SDK
    • 只selectVisual C++ Compilers
  • 运行npm install -g node-inspector --python="C:\Python27\python.exe"

如果仍然不行,试试这个:

  • 安装MS SDK x64 Libraries
  • 添加此行'AdditionalLibraryDirectories': 'C:\\Program Files\\Microsoft SDKs\\Windows\\v7.1\\Lib\\x64',在每个addon.gypifind
    • C:\nodejs\node_modules\node-gyp\addon.gypi
    • C:\Users\YOU\.node-gyp\0.12.7\deps\npm\node_modules\node-gyp\addon.gypi

addon.gypi

... 'msvs_settings': { 'VCLinkerTool': { 'DelayLoadDLLs': [ 'iojs.exe', 'node.exe' ], # Don't print a linker warning when no imports from either .exe # are used. 'AdditionalOptions': [ '/ignore:4199' ], # THIS LINE HERE 'AdditionalLibraryDirectories': 'C:\\Program Files\\Microsoft SDKs\\Windows\\v7.1\\Lib\\x64', }, ...

祝你好运!