Error MSB8007 when loading dependencies with npm and node

I am trying to install some packages in my node application with npm and I keep getting the error below. I get the same error with socket.io and mongo. I came across a number of different errors like this, and installed as many different things as a suggestion in other threads that I really don't know what the problem is. If anyone has any suggestions regarding what I need to download / install, I would really appreciate it.

$ 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 
+4
source share
3 answers

VS C ++ Express 2010 32bit is free. if you installed the 64-bit version of nodejs just uninstall it and install the 32-bit version of node.js

+10
source

I had a simallar problem and this is my solution. I am running windows 7 x64. I installed the x64 version of nodejs. I tried to run install, and this is what I got:

At first I wanted to put git in my path, which I did. then he wanted me to install python (not version 3.xx, but 2.xx) and put it in my path, which I did. Then I installed Visual Studio 2010 (C ++). after I did all this, I got this error:

D: \ Source \ xxxx \ grunt-raptr \ node_modules \ node_modules \ libxmljs \ build \ vendor \ libxml \ libxml.vcxproj (18.3): error MSB4019: imported project "D: \ Microsoft.Cpp.Default.props" not found. Verify that the path in the declaration is correct and that the file exists on disk.

I read somewhere that if you run it in visual studio cmd you can make it work, I tried this and I got this error:

<i> C: \ Program Files (x86) \ MSBuild \ Microsoft.Cpp \ v4.0 \ Microsoft.Cpp.InvalidPlatform.Targets (23.7): error MSB8007: The platform for the project 'libxml.vcxproj' is not valid. Platform = "64". You can see this message because you are trying to create a project without a solution file and you specified a non-standard platform that does not exist for this project. [D: \ Source \ xxxx \ node_modules \ grunt-Raptr \ node_modules \ libxmljs \ build \ provider \ LibXML \ Libxml. vcxproj]

As soon as I saw this, I installed nodejs again with the x32 version and it worked.

I hope this helps someone.

+3
source

When trying to install the node inspector: 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'

My car:

  • Win 7 64bit
  • node 0.12.7 64bit
  • Python 2.7 64bit

How I fixed it with all the tips found on the networks:

If this still does not work, try this:

  • install MS SDK x64 Libraries
  • add this line 'AdditionalLibraryDirectories': 'C:\\Program Files\\Microsoft SDKs\\Windows\\v7.1\\Lib\\x64', in each addon.gypi that you find
    • 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', }, ...

Good luck

0
source

Source: https://habr.com/ru/post/1485540/


All Articles