1

I'm running Node.js on an Ubuntu server through Microsoft Azure. I have a package.json that looks like this:

{
  "author"       : "Coop",
  "name"         : "app-framework",
  "main"         : "server.js",
  "version"      : "0.0.0",
  "private"      : true,
  "dependencies" : {
    "express"            : "~4.7.2",
    "morgan"             : "~1.5.0",
    "bcrypt"             : "~0.8.0",
    "forever"            : "~0.13.0",
    "mongodb"            : "~1.4.25",
    "mongoose"           : "~3.6.2",
    "nodemailer"         : "~1.3.0",
    "body-parser"        : "~1.9.2",
    "method-override"    : "~2.3.0",
    "express-session"    : "~1.9.3",
    "connect-mongostore" : "~0.1.4",
    "nodemailer-sendgrid-transport" : "~0.1.0"
  }
}

Now when I run sudo npm install, it tries to install the modules. However, if I then try and run my application with node server.js, I discover that some dependencies of my modules did not install.

I'm having to go through a long list and manually install lots of modules. Why is this happening and how can I just get everything to install correctly from the package.json?

2 Answers 2

1

So it turns out this was to do with the version of MongoDB. I just changed the version to 1.3.19 and everything was happy.

Sign up to request clarification or add additional context in comments.

Comments

0

Are you running npm install on Azure? Try npm install --production

1 Comment

Yes npm install on azure. I think it may be a problem with the version of MongoDB now. Something to do with that and compatibility with Mongoose.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.