Jump to content

Node.js + MongoDB


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 post
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 post
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 post
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 post
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 post
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 post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...