Jump to content

Node.js + MongoDB


smus

Recommended Posts

I don't think Node has error codes like that, 471 is probably a line number or something.  What is the actual error message?  Have you installed the mongodb packages before trying to install them on Node?

Link to comment
Share on other sites

You should be using NPM (which is what the example shows)

https://www.w3schools.com/nodejs/nodejs_mongodb.asp

$ npm install mongodb

 

To elaborate, Node is the JavaScript runtime environment, NPM is the package manager.  Using NPM to install Node packages for your project.

Link to comment
Share on other sites

11 hours ago, justsomeguy said:

I don't think Node has error codes like that, 471 is probably a line number or something.  What is the actual error message?  Have you installed the mongodb packages before trying to install them on Node?

Exactly! When I type "npm start" - this is the number of line in module.js file. There goes "Cannot find module 'express'" and then the same errors like in the previous message.

Link to comment
Share on other sites

1 hour ago, dsonesuk said:

Program files is a protected directory, did you open command prompt by right clicking it and selecting 'run as administrator'.

Running as an admin:

npm install mongodb - without errors

npm start - the same error

Link to comment
Share on other sites

Depending on version you used, you have to create a db folder which will hold database data, and configure the path to that folder, I should check documentation for your version to identify proper procedure for configuring. A pc restart may be required.

Edited by dsonesuk
Link to comment
Share on other sites

I've no idea where to configure an address of the db folder. I've installed node.js using Windows installer (from *.msi file). But MongoDB has been installed manually from zip file.

Link to comment
Share on other sites

Then where you got zip file MUST have documentation on how to setup database data folder? and configure on where this path should be placed, test it connects, and port to use. There are several ways to do this, apparently in programs folder, or on main drive under C:\ in it own folder.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...