Closed JFrankfurt closed 9 years ago
After I included mongoose and started trying to build out a User Schema we started getting the following errors:
{ [Error: Cannot find module '../build/Release/bson'] code: 'MODULE_NOT_FOUND' }
js-bson: Failed to load c++ bson extension, using pure JS version
And another saying mongoose.schema is undefined
Maybe it's referring to C:\Users\Phillip\Dropbox\GitHub\moonbasefaucet\node_modules\mongoose\node_modules\mongodb\node_modules\bson\node_modules\nan\build ??? Maybe there is supposed to be a release folder there with a bson module? Is it possible that mongoose updated and node hasn't complied with the updates yet? Just thinking out loud.
FIgured out the problem but don't know how to fix it. Call or text me if you want to know shit is hard to explain. It's not a problem with our code though, it's a problem with the version of mongoose node is installing.
tried skipping the os type check step and just gave bson an explicit "require('bson');" dependency. Didn't work.
@alexwaters if you've got a moment this is being freaking annoying.
C:\Users\Jordan\Google_Drive\DEVWORK\MoonBaseGames\FaucetPage\node_modules\mongodb\node_modules\bson>node "C:\Program Files (x86)\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node- gyp\bin\node-gyp.js" rebuild
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
MSBUILD : error MSB3428: Could not load the Visual C++ component "VCBuild.exe". To fix this, 1) install the .NET Framework 2.0 SDK, 2) install Microsoft Visual Studio 2005 or 3) add the location of the component to the system path if it is installed elsewhere. [C:\Users\Jordan\Google_Drive\DEVWORK\MoonBaseGames\FaucetPage\node_modules\mongodb\node_modules\bson\build\bi nding.sln]
mongodb@1.4.30 node_modules\mongodb
├── readable-stream@1.0.33 (isarray@0.0.1, string_decoder@0.10.31, inherits@2.0.1, core-util- is@1.0.1)
├── kerberos@0.0.8 (nan@1.5.1)
└── bson@0.2.18 (nan@1.5.1)
Maybe a retarded windows thing. Downloading MS Visual Studio so I have a C++ compiler...
Finished downloading MS Visual Studio and still got the error. { [Error: Cannot find module '../build/Release/bson'] code: 'MODULE_NOT_FOUND' } js-bson: Failed to load c++ bson extension, using pure JS version
Fixed that by copying the modified main bson index.js file to not select bson based on processor architecture and instead just require bson.
Then still got the error
c:\users\phillip\dropbox\github\moonbasefaucet\models\user.js:4
ObjectId = Schema.ObjectId;
^
ReferenceError: Schema is not defined
at Object.
Yeah I don't know how, but this is gone.
Mine is still doing it so what do you have that I don't.
Well shoot. Have you made sure you've installed MongoDB properly? That's the one thing I can think of that I did that may have affected this.
It's really confusing to get it right your first time. You have to create a new database folder at your root path.
Yeah I just made sure it was all right. Still having the { [Error: Cannot find module '../build/Release/bson'] code: 'MODULE_NOT_FOUND' } js-bson: Failed to load c++ bson extension, using pure JS version
problem.
you pulled down everything I've got up now?
And made sure you can get mongo running in your terminal?
If by in terminal you mean in a cmd window running in the test directory or a directory I create then yes. And yeah everything is pulled down.
https://www.youtube.com/watch?v=c6-K8bpBxxY
everything does this exactly?
Yupp exactly
lfgikhcjxkuhdyzvkiufhdik
I have that installed and iojs installed and I install the npm and then try to node index.js. Idk what is wrong.
I ran npm update and now that error went away and I am getting a cannot find module mongoose error.
$ node index.js
{ [Error: Cannot find module 'mongoose'] code: 'MODULE_NOT_FOUND' }
node.js:668
throw new TypeError('invalid pid');
^
TypeError: invalid pid
at process.kill (node.js:668:15)
at process.
Reinstalled and rebuilt mongoose with npm.
Now getting this.
$ node index.js { [Error: Cannot find module '../build/Release/bson'] code: 'MODULE_NOT_FOUND' }
js-bson: Failed to load c++ bson extension, using pure JS version { [Error: Cannot find module '../build/Release/bson'] code: 'MODULE_NOT_FOUND' }
js-bson: Failed to load c++ bson extension, using pure JS version
[TypeError: Undefined type at password.required
Did you try nesting Schemas? You can only nest using refs or arrays.]
node.js:668
throw new TypeError('invalid pid');
^
TypeError: invalid pid
at process.kill (node.js:668:15)
at process.
Can't get past that one googling the error.
No luck.
It was a password error in the Schema field for mongooses user schemas.
Error: [TypeError: Undefined type at password.required Did you try nesting Schemas? You can only nest using refs or arrays.] node.js:668 throw new TypeError('invalid pid');
Correction: Change user schema password field in user.js
password: { type: String, required: true, index: { unique: true }
Glad to hear you got it fixed. Ryan and I are in our last few weeks of class over here. Should be able to get going again soon after things slow down for us.
Python (???) something c++ dependencies and something something mongodb mongoose node-gyp rebuild bson