Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

error MSB8007 while downloading dependencies with npm and node

I am trying to install some packages in my node app with npm, and I keep getting the error below. I get the same error with socket.io and mongo. I have gone through a number of different errors similar to this, and have install so many different things as per suggestion in other threads that I really have no idea what the problem is. If anyone has any suggestion as to what I need to download/set I would greatly 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

> [email protected] 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

> [email protected] 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
d a 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]
[email protected] node_modules\mongodb
├── [email protected]
└── [email protected]
like image 989
cspada Avatar asked Dec 12 '22 14:12

cspada


2 Answers

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

like image 139
Koray Güclü Avatar answered May 01 '23 08:05

Koray Güclü


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 it wanted me to put git into my path, which I did. then it wanted me to install python (not version 3.x.x but 2.x.x) and put that in my path, which I did. Then I installed visual studio 2010 (c++). after I did all of this I got this error:

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" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk.

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

C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.Cpp.InvalidPlatform.Targets(23,7): error MSB8007: The Platform for project 'libxml.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. [D:\Source\xxxx\node_modules\grunt-raptr\node_modules\libxmljs\build\vendor\libxml\libxml. vcxproj]

Once I saw this I re-installed nodejs with the x32 version and everything worked.

I hope this helps someone.

like image 24
StuBob Avatar answered May 01 '23 09:05

StuBob