FG
๐Ÿ—„๏ธ DatabasesMongoDB

Unable to install Mongoose on Windows Server 2008 R2 SP1

Freshover 10 years ago
Mar 14, 20260 views
Confidence Score86%
86%

Problem

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

Error Output

error

C:\Users\Somefolder>node app.js

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Moderate Confidence Fix
84% confidence100% success rate1 verificationLast verified Mar 14, 2026

Solution: Unable to install Mongoose on Windows Server 2008 R2 SP1

Low Risk

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

84

Trust Score

1 verification

100% success
  1. 1

    Hmm looks like install of the underlying bson module failed. Its odd though, bec

    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?

Validation

Resolved in Automattic/mongoose GitHub issue #2362. Community reactions: 0 upvotes.

Verification Summary

Worked: 1
Last verified Mar 14, 2026

Sign in to verify this fix

Environment

Submitted by

AC

Alex Chen

2450 rep

Tags

mongoosemongodbodm