Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to install Mongoose on Windows Server 2008 R2 SP1 #2362

Closed
Bristlecone opened this issue Oct 10, 2014 · 34 comments
Closed

Unable to install Mongoose on Windows Server 2008 R2 SP1 #2362

Bristlecone opened this issue Oct 10, 2014 · 34 comments

Comments

@Bristlecone
Copy link

When tried npm install on Windows Server 2008 R2 SP1, it gives the following messages

C:\Users\someFolder>npm install mongoose-

kerberos@0.0.3 install C:\Users\SomeFolder\node_modules\mongoose\node_modules\mongodb\node_modules\kerberos
(node-gyp rebuild 2> builderror.log) || (exit 0)

npm WARN optional dep failed, continuing kerberos@0.0.3
npm WARN optional dep failed, continuing kerberos@0.0.3
mongoose@3.8.8 node_modules\mongoose
├── regexp-clone@0.0.1
├── sliced@0.0.5
├── muri@0.3.1
├── hooks@0.2.1
├── mpath@0.1.1
├── mpromise@0.4.3
├── ms@0.1.0
├── mquery@0.5.3 (debug@0.7.4)
└── mongodb@1.3.23

bson@0.2.5 install C:\Users\SomeFolder\node_modules\mongoose\node_modules\mongodb\node_modules\bson
(node-gyp rebuild 2> builderror.log) || (exit 0)

When I run the app, I receive the following error

C:\Users\Somefolder>node app.js

module.js:340
throw err;
^
Error: Cannot find module 'bson'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object. (C:\Users\Somefolder\node_mod
ules\agenda\node_modules\mongoskin\node_modules\mongodb\lib\mongodb\collection.j
s:10:16)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)

@vkarpov15
Copy link
Collaborator

Hmm looks like install of the underlying bson module failed. Its odd though, because the bson module, in theory, falls back to a JS-only implementation if the C++ extension fails to compile. The kerberos failure is not really a problem (unless you want to use Kerberos SSPI with MongoDB that is). Can you tell me which version of node and npm you're using, and what version of mongoose you're trying to install?

@vkarpov15 vkarpov15 added the bug? label Oct 11, 2014
@Bristlecone
Copy link
Author

Sure. Here are the stats

Node: 0.10.32
NPM: 1.4.28
Mongoose: 3.8.17
MongoDB: 2.6.5

Let me know if any other details are required.

@vkarpov15 vkarpov15 added this to the 3.8.19 milestone Oct 13, 2014
@Bristlecone
Copy link
Author

@vkarpov15; Any workaround till the bug is fixed in the next release?

@vkarpov15
Copy link
Collaborator

Hmmm it looks like the error is actually in mongoskin rather than mongoose. Try not requiring mongoskin and see if that helps.

at Object. (C:\Users\Somefolder\node_mod
ules\agenda\node_modules\**mongoskin**\node_modules\mongodb\lib\mongodb\collection.j
s:10:16)

@vkarpov15
Copy link
Collaborator

No responses for 3 weeks and looks like this is an error in another module. Closing.

@vkarpov15 vkarpov15 removed this from the 3.8.19 milestone Nov 9, 2014
@vkarpov15 vkarpov15 removed the bug? label Nov 9, 2014
@GIOkafor
Copy link

I have the exact same problem only difference is I'm not doing anything with mongoskin
(node-gyp rebuild 2> builderror.log) || (exit 0)

When I run 'node server.js' this gets returned:

module.js:340
throw err;
^
Error: Cannot find module 'bson'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object. (C:\Users\someUser\Desktop\showtra
ckr\node_modules\mongoose\node_modules\mongodb\lib\mongodb\collection.js:10:16)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)

Any help would be really appreciated thanks.

@vkarpov15
Copy link
Collaborator

Did your npm install succeed? Looks like bson just isn't there.

@GIOkafor
Copy link

It didn't say, all I get is (node-gyp rebuild 2> builderror.log) || (exit 0) and then nothing happens until I hit Ctrl+C. However checking the node_modules folder, I find the mongo folder there but when I call node server.js the error shows up.

@vkarpov15
Copy link
Collaborator

Try wiping out your node_modules folder and then doing a clean npm install. That may help.

@GIOkafor
Copy link

Tried doing that it runs and gets stuck showing this: (node-gyp rebuild 2> builderror.log) || (exit 0) tried starting up my server again and it gives me the same error. I even tried deleting just the individual mongo folder and that didn't help either.

@GIOkafor
Copy link

Tail end of result with --verbose included in the install command:

debugimg

@vkarpov15
Copy link
Collaborator

Ok so the kerberos library's what's hanging up. Try doing npm install mongoose --no-optional, that will skip the kerberos library. Hopefully that'll help.

@GIOkafor
Copy link

Got this as a result of running that, once again with verbose
debu2

@vkarpov15
Copy link
Collaborator

Hmmm do you have python and visual studio installed on this machine? node-gyp requires those two for some strange reason. Also, if you have those installed, try:

npm install --msvs_version=<visual studio version>

As suggested here

@GIOkafor
Copy link

I have python installed but not visual studio, installing that right now. Will try after that and let you know how it goes. Thanks.

@GIOkafor
Copy link

Tried running the command with visual studio installed and I get a message saying the syntax is incorrect.

@vkarpov15
Copy link
Collaborator

Which version of VS?

@GIOkafor
Copy link

Visual studio community 2013

@vkarpov15
Copy link
Collaborator

Can you show me the error message output?

@vkarpov15 vkarpov15 reopened this Jan 31, 2015
@GIOkafor
Copy link

Here it is:

debu3

@vkarpov15
Copy link
Collaborator

Hmm looks like you're passing an incorrect visual studio syntax. Try just running npm install, followed by npm install --msvs_version=2013 if the first command doesn't work.

@GIOkafor
Copy link

GIOkafor commented Feb 3, 2015

Both commands worked fine, but npm install mongoose --no-optional --verbose freezes like before and has the same output of the second image I uploaded.

@goforgold
Copy link

I faced similar issues today. After a lot of Google searches it worked with following way

npm install -g mongodb --python=python27 --msvs_version=2013

Issues was:

  1. I had latest python installed on my windows machine (3.4) but mongodb required lower version. So I just grabbed that version and installed it and specified which version of python should be used when compiling moongodb.
  2. It was trying to use Visual Studio 2010 tools to build. I have VS2013 installed so I found out a way to which VS version to use.

And it worked.

But still it is the first node module which I couldn't install with a single command. I had to waste nearly 2 hour in installing it.

I am not happy with it. I still have questions like:

  1. Why Python is required to use mongodb with NodeJs ?
  2. Why VS is required at all ?

Why can't I simply install it like a just one another npm module ?

@vkarpov15
Copy link
Collaborator

First, you can install mongoose without the node-gyp dependencies at all. You just won't get the C++ bson parser, you'll get the JavaScript BSON parser. In theory, if you install mongoose without python or VS, you'll just get a js-bson warning when your application starts.

Re: 1 and 2, the python and VS dependencies come via the mongodb C++ bson parser and kerberos auth module. These are implemented as nodejs native add-ons, which need to be compiled via https://github.com/tootallnate/node-gyp, which wraps the V8 build tool 'gyp', which requires python and VS on Windows. Trust me, I dislike this dependency as much as you do, but there's a good reason for it. The reason is that the C++ bson parser has marginally less memory overhead and more predictable performance than the JavaScript implementation, and because AFAIK you can't really implement Kerberos auth on windows without being able to call secur32.dll directly. We'd like to figure out a way to close the gap on bson parser performance, but for now you just get a fallback to the JavaScript bson implementation.

@ghost
Copy link

ghost commented Aug 3, 2015

capture

i have similar issue, when i type npm install --save mongoose it gives me that on picture above,
then i waits for about 10 min an then gives me second picture.
capture2

i have python 2.7.10 installed i am running on windows 10, and i don't have visual studio installed,
but i have visual c++ redistributables installed for vs2013 and vs2015 do i need to install the whole ide ? and which one ? and will it be enough if i custom install only C++, i don't want to install F# C# VB or anything else, thank you ))

@ghost
Copy link

ghost commented Aug 3, 2015

capture3
one more thing is this picture after all of these warnings, thank you.

@vkarpov15
Copy link
Collaborator

I don't see any real warnings above, looks like a normal npm install. If you upgrade to latest mongoose you shouldn't even see the messages about bson-ext.

@ghost
Copy link

ghost commented Aug 3, 2015

it looks like normal but it is not included in my dependencies after installation and then it gives me an error when i try to interact with mongodb! ?? so frustrating i am trying to fix this since two days now, hey about visual studio can you tell me what to do ? i dont really use that i use visual studio code.
is it enough for node if i have redistributables ? thank you

@vkarpov15
Copy link
Collaborator

What's the error? And you shouldn't need visual studio at all unless you care about integrating mongodb into your kerberos cluster.

@ghost
Copy link

ghost commented Aug 4, 2015

hey it's freaking worked i just turned my laptop on and it worked ??

@ghost
Copy link

ghost commented Aug 4, 2015

hey can you help me with this one ?
capture
i double checked i don't have any type errors?

@ghost
Copy link

ghost commented Aug 4, 2015

here is the error i was getting
capture2
it gives me an error if i am not connected to the internet, is there any ways i can work offline ? thank yo u

@ghost
Copy link

ghost commented Aug 4, 2015

hey man i figured this out. app.use(multer({dest:'./public/images/uploads/'}).single('photo'));
i was using. app.use(multer({dest: './public/images/uploads'}));
now it works perfectly i love coding, again

@vkarpov15
Copy link
Collaborator

Glad you figured it out 🍻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants