Ubuntu 16.04 mean.js installation (without using one click app)

June 17, 2017 660 views
MEAN Node.js Ubuntu 16.04

I am trying to install mean.js on my ubuntu 16.04 using the following guide. And I keep getting stuck at the grunt stage.

https://www.digitalocean.com/community/tutorials/how-to-install-a-mean-js-stack-on-an-ubuntu-14-04-server

There were issues with building node so I install using nvm
https://www.digitalocean.com/community/tutorials/how-to-install-node-js-on-ubuntu-16-04#how-to-install-using-nvm

Then there were issues with bower where the process was killed. Managed to solved that by adding swap. I have the 512 MB ram settings.
https://www.digitalocean.com/community/tutorials/how-to-add-swap-on-ubuntu-14-04

Now my problem is grunt. I now have this error.

/opt/mean$ grunt
A valid Gruntfile could not be found. Please see the getting started guide for
more information on how to configure grunt: http://gruntjs.com/getting-started
Fatal error: Unable to find Gruntfile.

Then when I tried

/opt/mean$ npm install
npm WARN checkPermissions Missing write access to /opt/mean/nodemodules/tiny-lr/nodemodules
npm WARN checkPermissions Missing write access to /opt/mean/nodemodules/tiny-lr/nodemodules/body-parser/nodemodules
npm WARN checkPermissions Missing write access to /opt/mean/node
modules/tiny-lr/nodemodules/raw-body/nodemodules
npm WARN eslint-config-airbnb@6.0.2 requires a peer of eslint-plugin-react@^4.0.0 but none was installed.
npm ERR! path /opt/mean/nodemodules/tiny-lr/nodemodules
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall access
npm ERR! Error: EACCES: permission denied, access '/opt/mean/nodemodules/tiny-lr/nodemodules'
npm ERR! at Error (native)
npm ERR! { Error: EACCES: permission denied, access '/opt/mean/nodemodules/tiny-lr/nodemodules'
npm ERR! at Error (native)
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'access',
npm ERR! path: '/opt/mean/nodemodules/tiny-lr/nodemodules' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/ktyc/.npm/logs/2017-06-17T084313072Z-debug.log

This is my second droplet try.

If anyone need me to edit the question or require more information, just leave a message.

10 Answers

Hi @tengyong80

From looking at the error log, it looks like you don't have permissions to the /opt/mean directory with the current user you're logged in as.
So either change permissions to allow that user access - or run the commands as root or with sudo.

@tengyong80

You're totally right, when you use sudo you don't need to use the root login, but your first post didn't use sudo or root.

All the errors involves some type of permissions problem, so have a look at these:
https://docs.npmjs.com/getting-started/fixing-npm-permissions
https://til.codes/npm-install-failed-with-cannot-run-in-wd-2/
https://stackoverflow.com/questions/18136746/npm-install-failed-with-cannot-run-in-wd

@hansen

I created a new droplet and instead of using the previous tutorials
cd /opt/mean
sudo npm install

I am using npm install as per https://github.com/meanjs/mean
So I am now getting errors only at the Mongo part.
Do you have any idea on why this is happening?

I am using the guides here
https://www.digitalocean.com/community/tutorials/how-to-install-mongodb-on-ubuntu-16-04
https://www.digitalocean.com/community/tutorials/how-to-install-and-secure-mongodb-on-ubuntu-16-04

I added the administrative user for Mongo as below. myuser and mypassword are placeholder for our discussion here. I thought this would have solved the authorized issue.

use admin
db.createUser(
{
user: "myuser",
pwd: ";mypassword",
roles: [ { role: "userAdminAnyDatabase", db: "admin" } ]
}
)

$ npm start

meanjs@0.5.0 start /home/ktyc/meanjs
gulp

[06:42:17] Using gulpfile ~/meanjs/gulpfile.js
[06:42:17] Starting 'default'...
[06:42:17] Starting 'env:dev'...
[06:42:17] Finished 'env:dev' after 241 μs
[06:42:17] Starting 'copyLocalEnvConfig'...
[06:42:17] Starting 'makeUploadsDir'...
[06:42:17] Finished 'makeUploadsDir' after 566 μs
[06:42:17] Finished 'copyLocalEnvConfig' after 32 ms
[06:42:17] Starting 'lint'...
[06:42:17] Starting 'less'...
[06:42:19] Finished 'less' after 1.56 s
[06:42:19] Starting 'sass'...
[06:42:19] Finished 'sass' after 464 ms
[06:42:19] Starting 'csslint'...
[06:42:20] Starting 'eslint'...
[06:42:22] Finished 'csslint' after 2.95 s
[06:42:33] Finished 'eslint' after 13 s
[06:42:33] Finished 'lint' after 15 s
[06:42:33] Starting 'nodemon'...
[06:42:33] Finished 'nodemon' after 208 ms
[06:42:33] Starting 'watch'...
[06:42:33] Finished 'watch' after 456 ms
[06:42:33] Finished 'default' after 16 s
[06:42:33] [nodemon] 1.11.0
[06:42:33] [nodemon] to restart at any time, enter rs
[06:42:33] [nodemon] ignoring: /home/ktyc/meanjs/.git//* .nycoutput .sass-cac he bowercomponents coverage /home/ktyc/meanjs/node_modules//*
[06:42:33] [nodemon] watching: modules//server/views/.html server.js config/** /.js modules//server/*/.js modules//server/config/.js
[06:42:33] [nodemon] watching extensions: js,html
[06:42:33] [nodemon] starting node --debug server.js
[06:42:33] [nodemon] child pid: 4035
Debugger listening on [::]:5858
[06:42:34] [nodemon] watching 174 files

+ Important warning: config.domain is empty. It should be set to the fully quali fied domain of the app.

MEAN.JS - Development Environment

Environment: development
Server: http://0.0.0.0:3000
Database: mongodb://localhost/mean-dev
App version: 0.5.0

MEAN.JS version: 0.5.0

Unhandled rejection MongoError: not authorized on mean-dev to execute command { listIndexes: "sessions", cursor: {} }
at Function.MongoError.create (/home/ktyc/meanjs/nodemodules/mongoose/node modules/mongodb-core/lib/error.js:31:11)
at queryCallback (/home/ktyc/meanjs/nodemodules/mongoose/nodemodules/mongo db-core/lib/cursor.js:212:36)
From previous event:
at MongoStore.setAutoRemoveAsync (/home/ktyc/meanjs/nodemodules/connect-mon go/src/index.js:129:40)
at MongoStore.handleNewConnectionAsync (/home/ktyc/meanjs/node
modules/conne ct-mongo/src/index.js:121:18)
at MongoStore (/home/ktyc/meanjs/nodemodules/connect-mongo/src/index.js:89: 26)
at Object.module.exports.initSession (/home/ktyc/meanjs/config/lib/express.j s:120:12)
at Object.module.exports.init (/home/ktyc/meanjs/config/lib/express.js:242:8 )
at /home/ktyc/meanjs/config/lib/app.js:25:23
at /home/ktyc/meanjs/config/lib/mongoose.js:38:15
at /home/ktyc/meanjs/node
modules/mongoose/lib/connection.js:316:19
at open (/home/ktyc/meanjs/nodemodules/mongoose/lib/connection.js:682:17)
at NativeConnection.Connection.onOpen (/home/ktyc/meanjs/node
modules/mongoo se/lib/connection.js:692:5)
at /home/ktyc/meanjs/nodemodules/mongoose/lib/connection.js:652:11
at /home/ktyc/meanjs/node
modules/mongoose/lib/drivers/node-mongodb-native/c onnection.js:71:5
at /home/ktyc/meanjs/nodemodules/mongoose/nodemodules/mongodb/lib/db.js:23 8:5
at Server.connectHandler (/home/ktyc/meanjs/nodemodules/mongoose/nodemodul es/mongodb/lib/server.js:339:7)
at Server.g (events.js:292:16)
at emitOne (events.js:96:13)
at Server.emit (events.js:188:7)
at /home/ktyc/meanjs/nodemodules/mongoose/nodemodules/mongodb-core/lib/top ologies/server.js:299:14
at /home/ktyc/meanjs/nodemodules/mongoose/nodemodules/mongodb-core/lib/con nection/pool.js:469:18
at combinedTickCallback (internal/process/nexttick.js:73:7)
at process.tickCallback (internal/process/nexttick.js:104:9)

Unhandled rejection MongoError: not authorized on mean-dev to execute command { listIndexes: "sessions", cursor: {} }
at Function.MongoError.create (/home/ktyc/meanjs/nodemodules/mongoose/node modules/mongodb-core/lib/error.js:31:11)
at queryCallback (/home/ktyc/meanjs/nodemodules/mongoose/nodemodules/mongo db-core/lib/cursor.js:212:36)
From previous event:
at MongoStore.setAutoRemoveAsync (/home/ktyc/meanjs/nodemodules/connect-mon go/src/index.js:129:40)
at MongoStore.handleNewConnectionAsync (/home/ktyc/meanjs/node
modules/conne ct-mongo/src/index.js:121:18)
at MongoStore (/home/ktyc/meanjs/nodemodules/connect-mongo/src/index.js:89: 26)
at module.exports (/home/ktyc/meanjs/config/lib/socket.io.js:73:20)
at Object.module.exports.configureSocketIO (/home/ktyc/meanjs/config/lib/exp ress.js:213:38)
at Object.module.exports.init (/home/ktyc/meanjs/config/lib/express.js:257:1 4)
at /home/ktyc/meanjs/config/lib/app.js:25:23
at /home/ktyc/meanjs/config/lib/mongoose.js:38:15
at /home/ktyc/meanjs/node
modules/mongoose/lib/connection.js:316:19
at open (/home/ktyc/meanjs/nodemodules/mongoose/lib/connection.js:682:17)
at NativeConnection.Connection.onOpen (/home/ktyc/meanjs/node
modules/mongoo se/lib/connection.js:692:5)
at /home/ktyc/meanjs/nodemodules/mongoose/lib/connection.js:652:11
at /home/ktyc/meanjs/node
modules/mongoose/lib/drivers/node-mongodb-native/c onnection.js:71:5
at /home/ktyc/meanjs/nodemodules/mongoose/nodemodules/mongodb/lib/db.js:23 8:5
at Server.connectHandler (/home/ktyc/meanjs/nodemodules/mongoose/nodemodul es/mongodb/lib/server.js:339:7)
at Server.g (events.js:292:16)
at emitOne (events.js:96:13)
at Server.emit (events.js:188:7)
at /home/ktyc/meanjs/nodemodules/mongoose/nodemodules/mongodb-core/lib/top ologies/server.js:299:14
at /home/ktyc/meanjs/nodemodules/mongoose/nodemodules/mongodb-core/lib/con nection/pool.js:469:18
at combinedTickCallback (internal/process/nexttick.js:73:7)
at process.tickCallback (internal/process/nexttick.js:104:9)

MongoDB is a free and open-source NoSQL document database used commonly in modern web applications. This tutorial will help you set up MongoDB on your server for a production application environment.
  • @tengyong80

    Can you connect to mongo by running this:

    mongo --port 27017
    

    Now you should be in the mongo shell and then run this:

    use admin
    db.auth("myuser", "mypassword" )
    db.grantRolesToUser("myuser", [ { role: "read", db: "admin" } ])
    db.grantRolesToUser("myuser", [ { role: "readWrite", db: "mean-dev" } ])
    
    show users
    

    The last command (show users) is just to confirm the users and their grants.

    The primary thing is to allow read+write access to mean-dev which is the database used in your setup - we can see that from the error not authorized on mean-dev to execute command.

    But may I recommend - from a security stand - that you have 1 administrator user, which has access to admin and can create users, and then you create a user for each database with read+write access.

    You can read more here:
    https://docs.mongodb.com/manual/tutorial/enable-authentication/
    https://stackoverflow.com/questions/35881662/show-dbs-gives-not-authorized-to-execute-command-error

@hansen

I will implement that security feature next time.

I did what you highlighted and I got the below after I ran npm install in the project folder.
It's only 3 warning but meanjs doesn't seem to be running.

ktyc@Mark1:~$ cd meanjs
ktyc@Mark1:~/meanjs$
ktyc@Mark1:~/meanjs$ npm install

meanjs@0.5.0 postinstall /home/ktyc/meanjs
npm run bower

meanjs@0.5.0 bower /home/ktyc/meanjs
bower install --allow-root && bower prune --allow-root

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (nodemodules/ch okidar/nodemodules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@ 1.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"} )
npm WARN eslint-config-airbnb@6.0.2 requires a peer of eslint-plugin-react@^4.0. 0 but none was installed.
ktyc@Mark1:~/meanjs$

  • @tengyong80
    But that's the install - that will not run the project.
    Have a look in the log files - there is usually an answer saved there :-)
    And in the future, please use the </> button in the comment editor to save the formatting of your code - and also make it easier to read.

    Formatted code will look like this. And can contain _ without making text italic
    

@hansen

Yeap I got excited. I ran npm start and I still got the same error.

--
MEAN.JS - Development Environment

Environment:     development
Server:          http://0.0.0.0:3000
Database:        mongodb://localhost/mean-dev
App version:     0.5.0
MEAN.JS version: 0.5.0
--
Unhandled rejection MongoError: not authorized on mean-dev to execute command { listIndexes: "sessions", cursor: {} }
    at Function.MongoError.create (/home/ktyc/meanjs/node_modules/mongoose/node_modules/mongodb-core/lib/error.js:31:11)
    at queryCallback (/home/ktyc/meanjs/node_modules/mongoose/node_modules/mongodb-core/lib/cursor.js:212:36)
From previous event:
    at MongoStore.setAutoRemoveAsync (/home/ktyc/meanjs/node_modules/connect-mongo/src/index.js:129:40)
    at MongoStore.handleNewConnectionAsync (/home/ktyc/meanjs/node_modules/connect-mongo/src/index.js:121:18)
    at MongoStore (/home/ktyc/meanjs/node_modules/connect-mongo/src/index.js:89:26)
    at Object.module.exports.initSession (/home/ktyc/meanjs/config/lib/express.js:120:12)
    at Object.module.exports.init (/home/ktyc/meanjs/config/lib/express.js:242:8)
    at /home/ktyc/meanjs/config/lib/app.js:25:23
    at /home/ktyc/meanjs/config/lib/mongoose.js:38:15
    at /home/ktyc/meanjs/node_modules/mongoose/lib/connection.js:316:19
    at open (/home/ktyc/meanjs/node_modules/mongoose/lib/connection.js:682:17)
    at NativeConnection.Connection.onOpen (/home/ktyc/meanjs/node_modules/mongoose/lib/connection.js:692:5)
    at /home/ktyc/meanjs/node_modules/mongoose/lib/connection.js:652:11
    at /home/ktyc/meanjs/node_modules/mongoose/lib/drivers/node-mongodb-native/connection.js:71:5
    at /home/ktyc/meanjs/node_modules/mongoose/node_modules/mongodb/lib/db.js:238:5
    at Server.connectHandler (/home/ktyc/meanjs/node_modules/mongoose/node_modules/mongodb/lib/server.js:339:7)
    at Server.g (events.js:292:16)
    at emitOne (events.js:96:13)
    at Server.emit (events.js:188:7)
    at /home/ktyc/meanjs/node_modules/mongoose/node_modules/mongodb-core/lib/topologies/server.js:299:14
    at /home/ktyc/meanjs/node_modules/mongoose/node_modules/mongodb-core/lib/connection/pool.js:469:18
    at _combinedTickCallback (internal/process/next_tick.js:73:7)
    at process._tickCallback (internal/process/next_tick.js:104:9)

Unhandled rejection MongoError: not authorized on mean-dev to execute command { listIndexes: "sessions", cursor: {} }
    at Function.MongoError.create (/home/ktyc/meanjs/node_modules/mongoose/node_modules/mongodb-core/lib/error.js:31:11)
    at queryCallback (/home/ktyc/meanjs/node_modules/mongoose/node_modules/mongodb-core/lib/cursor.js:212:36)
From previous event:
    at MongoStore.setAutoRemoveAsync (/home/ktyc/meanjs/node_modules/connect-mongo/src/index.js:129:40)
    at MongoStore.handleNewConnectionAsync (/home/ktyc/meanjs/node_modules/connect-mongo/src/index.js:121:18)
    at MongoStore (/home/ktyc/meanjs/node_modules/connect-mongo/src/index.js:89:26)
    at module.exports (/home/ktyc/meanjs/config/lib/socket.io.js:73:20)
    at Object.module.exports.configureSocketIO (/home/ktyc/meanjs/config/lib/express.js:213:38)
    at Object.module.exports.init (/home/ktyc/meanjs/config/lib/express.js:257:14)
    at /home/ktyc/meanjs/config/lib/app.js:25:23
    at /home/ktyc/meanjs/config/lib/mongoose.js:38:15
    at /home/ktyc/meanjs/node_modules/mongoose/lib/connection.js:316:19
    at open (/home/ktyc/meanjs/node_modules/mongoose/lib/connection.js:682:17)
    at NativeConnection.Connection.onOpen (/home/ktyc/meanjs/node_modules/mongoose/lib/connection.js:692:5)
    at /home/ktyc/meanjs/node_modules/mongoose/lib/connection.js:652:11
    at /home/ktyc/meanjs/node_modules/mongoose/lib/drivers/node-mongodb-native/connection.js:71:5
    at /home/ktyc/meanjs/node_modules/mongoose/node_modules/mongodb/lib/db.js:238:5
    at Server.connectHandler (/home/ktyc/meanjs/node_modules/mongoose/node_modules/mongodb/lib/server.js:339:7)
    at Server.g (events.js:292:16)
    at emitOne (events.js:96:13)
    at Server.emit (events.js:188:7)
    at /home/ktyc/meanjs/node_modules/mongoose/node_modules/mongodb-core/lib/topologies/server.js:299:14
    at /home/ktyc/meanjs/node_modules/mongoose/node_modules/mongodb-core/lib/connection/pool.js:469:18
    at _combinedTickCallback (internal/process/next_tick.js:73:7)
    at process._tickCallback (internal/process/next_tick.js:104:9)

  • Can you run this to verify the users and their grants:

    mongo --port 27017
    use admin
    db.auth("myuser", "mypassword")
    show users
    

    And which user are you connecting with in your Node app configuration?

@hansen
Below are the users generated.
I don't know which user are connected to the Node app.

{
        "_id" : "admin.ktyc",
        "user" : "ktyc",
        "db" : "admin",
        "roles" : [
                {
                        "role" : "root",
                        "db" : "admin"
                },
                {
                        "role" : "readWrite",
                        "db" : "mean-dev"
                },
                {
                        "role" : "read",
                        "db" : "admin"
                },
                {
                        "role" : "userAdminAnyDatabase",
                        "db" : "admin"
                }
        ]
}
  • So you need to look in your configuration of your Node app - it's usually in a file called config.js, but again, this can be different depending on your app.
    Did you create it yourself, then you should know. If it's a project, you've downloaded, then just paste a link here and I'll try to see if I can find the config.

    • [https://github.com/meanjs/mean](http://)
      I used the command below from the link above

      git clone https://github.com/meanjs/mean.git meanjs
      

      I found the file you mentioned in /home/ktyc/meanjs/config/config.js and I pasted it below

      'use strict';
      
      /**
       * Module dependencies.
       */
      var _ = require('lodash'),
        chalk = require('chalk'),
        glob = require('glob'),
        fs = require('fs'),
        path = require('path');
      
      /**
       * Get files by glob patterns
       */
      var getGlobbedPaths = function (globPatterns, excludes) {
        // URL paths regex
        var urlRegex = new RegExp('^(?:[a-z]+:)?\/\/', 'i');
      
        // The output array
        var output = [];
      
        // If glob pattern is array then we use each pattern in a recursive way, otherwise we use glob
        if (_.isArray(globPatterns)) {
          globPatterns.forEach(function (globPattern) {
            output = _.union(output, getGlobbedPaths(globPattern, excludes));
          });
        } else if (_.isString(globPatterns)) {
          if (urlRegex.test(globPatterns)) {
            output.push(globPatterns);
          } else {
            var files = glob.sync(globPatterns);
            if (excludes) {
              files = files.map(function (file) {
                if (_.isArray(excludes)) {
                  for (var i in excludes) {
                    if (excludes.hasOwnProperty(i)) {
                      file = file.replace(excludes[i], '');
                    }
                  }
                } else {
                  file = file.replace(excludes, '');
                }
                return file;
              });
            }
            output = _.union(output, files);
          }
        }
      
        return output;
      };
      
      /**
       * Validate NODE_ENV existence
       */
      var validateEnvironmentVariable = function () {
        var environmentFiles = glob.sync('./config/env/' + process.env.NODE_ENV + '.js');
        console.log();
        if (!environmentFiles.length) {
          if (process.env.NODE_ENV) {
            console.error(chalk.red('+ Error: No configuration file found for "' + process.env.NODE_ENV + '" environment using development instead'));
          } else {
            console.error(chalk.red('+ Error: NODE_ENV is not defined! Using default development environment'));
          }
          process.env.NODE_ENV = 'development';
        }
        // Reset console color
        console.log(chalk.white(''));
      };
      
      /** Validate config.domain is set
       */
      var validateDomainIsSet = function (config) {
        if (!config.domain) {
          console.log(chalk.red('+ Important warning: config.domain is empty. It should be set to the fully qualified domain of the app.'));
        }
      };
      
      /**
       * Validate Secure=true parameter can actually be turned on
       * because it requires certs and key files to be available
       */
      var validateSecureMode = function (config) {
      
        if (!config.secure || config.secure.ssl !== true) {
          return true;
        }
      
        var privateKey = fs.existsSync(path.resolve(config.secure.privateKey));
        var certificate = fs.existsSync(path.resolve(config.secure.certificate));
      
        if (!privateKey || !certificate) {
          console.log(chalk.red('+ Error: Certificate file or key file is missing, falling back to non-SSL mode'));
          console.log(chalk.red('  To create them, simply run the following from your shell: sh ./scripts/generate-ssl-certs.sh'));
          console.log();
          config.secure.ssl = false;
        }
      };
      
      /**
       * Validate Session Secret parameter is not set to default in production
       */
      var validateSessionSecret = function (config, testing) {
      
        if (process.env.NODE_ENV !== 'production') {
          return true;
        }
      
        if (config.sessionSecret === 'MEAN') {
          if (!testing) {
            console.log(chalk.red('+ WARNING: It is strongly recommended that you change sessionSecret config while running in production!'));
            console.log(chalk.red('  Please add `sessionSecret: process.env.SESSION_SECRET || \'super amazing secret\'` to '));
            console.log(chalk.red('  `config/env/production.js` or `config/env/local.js`'));
            console.log();
          }
          return false;
        } else {
          return true;
        }
      };
      
      /**
       * Initialize global configuration files
       */
      var initGlobalConfigFolders = function (config, assets) {
        // Appending files
        config.folders = {
          server: {},
          client: {}
        };
      
        // Setting globbed client paths
        config.folders.client = getGlobbedPaths(path.join(process.cwd(), 'modules/*/client/'), process.cwd().replace(new RegExp(/\\/g), '/'));
      };
      
      /**
       * Initialize global configuration files
       */
      var initGlobalConfigFiles = function (config, assets) {
        // Appending files
        config.files = {
          server: {},
          client: {}
        };
      
        // Setting Globbed model files
        config.files.server.models = getGlobbedPaths(assets.server.models);
      
        // Setting Globbed route files
        config.files.server.routes = getGlobbedPaths(assets.server.routes);
      
        // Setting Globbed config files
        config.files.server.configs = getGlobbedPaths(assets.server.config);
      
        // Setting Globbed socket files
        config.files.server.sockets = getGlobbedPaths(assets.server.sockets);
      
        // Setting Globbed policies files
        config.files.server.policies = getGlobbedPaths(assets.server.policies);
      
        // Setting Globbed js files
        config.files.client.js = getGlobbedPaths(assets.client.lib.js, 'public/').concat(getGlobbedPaths(assets.client.js, ['public/']));
      
        // Setting Globbed css files
        config.files.client.css = getGlobbedPaths(assets.client.lib.css, 'public/').concat(getGlobbedPaths(assets.client.css, ['public/']));
      
        // Setting Globbed test files
        config.files.client.tests = getGlobbedPaths(assets.client.tests);
      };
      
      /**
       * Initialize global configuration
       */
      var initGlobalConfig = function () {
        // Validate NODE_ENV existence
        validateEnvironmentVariable();
      
        // Get the default assets
        var defaultAssets = require(path.join(process.cwd(), 'config/assets/default'));
      
        // Get the current assets
        var environmentAssets = require(path.join(process.cwd(), 'config/assets/', process.env.NODE_ENV)) || {};
      
        // Merge assets
        var assets = _.merge(defaultAssets, environmentAssets);
      
        // Get the default config
        var defaultConfig = require(path.join(process.cwd(), 'config/env/default'));
      
        // Get the current config
        var environmentConfig = require(path.join(process.cwd(), 'config/env/', process.env.NODE_ENV)) || {};
      
        // Merge config files
        var config = _.merge(defaultConfig, environmentConfig);
      
        // read package.json for MEAN.JS project information
        var pkg = require(path.resolve('./package.json'));
        config.meanjs = pkg;
      
        // Extend the config object with the local-NODE_ENV.js custom/local environment. This will override any settings present in the local configuration.
        config = _.merge(config, (fs.existsSync(path.join(process.cwd(), 'config/env/local-' + process.env.NODE_ENV + '.js')) && require(path.join(process.cwd(), 'config/env/local-' + process.env.NODE_ENV + '.js'))) || {});
      
        // Initialize global globbed files
        initGlobalConfigFiles(config, assets);
      
        // Initialize global globbed folders
        initGlobalConfigFolders(config, assets);
      
        // Validate Secure SSL mode can be used
        validateSecureMode(config);
      
        // Validate session secret
        validateSessionSecret(config);
      
        // Print a warning if config.domain is not set
        validateDomainIsSet(config);
      
        // Expose configuration utilities
        config.utils = {
          getGlobbedPaths: getGlobbedPaths,
          validateSessionSecret: validateSessionSecret
        };
      
        return config;
      };
      
      /**
       * Set configuration object
       */
      module.exports = initGlobalConfig();
      
      

@hansen

My answers were rejected as spam. I am not sure why.
I suspect I misused the link funtion here.

I created an account in pastebin with the reply I intended.
I hope it works.
My reply here in pastebin

  • @tengyong80
    But that's not the app - that's the stack/framework.
    Otherwise I don't understand what you're trying to do and it would probably be easier to remove the authentication of Mongo until you got a hang of Node.

@hansen
I am trying to verify that my installation is alright by getting the window below.
Mean successful installation
Unless there is another way to verify this?

@hansen

Thanks, I will try other alternatives too.
Anyway I pasted the results of the command.

ktyc@Mark1:~$ egrep -ril "27017|mongo" /home/ktyc/meanjs
/home/ktyc/meanjs/node_modules/mongodb-core/conf.json
/home/ktyc/meanjs/node_modules/mongodb-core/connect_test.js
/home/ktyc/meanjs/node_modules/mongodb-core/test34.js
/home/ktyc/meanjs/node_modules/mongodb-core/TESTING.md
/home/ktyc/meanjs/node_modules/mongodb-core/test1.js
/home/ktyc/meanjs/node_modules/mongodb-core/index.js
/home/ktyc/meanjs/node_modules/mongodb-core/THIRD-PARTY-NOTICES
/home/ktyc/meanjs/node_modules/mongodb-core/yarn.lock
/home/ktyc/meanjs/node_modules/mongodb-core/lib/auth/gssapi.js
/home/ktyc/meanjs/node_modules/mongodb-core/lib/auth/scram.js
/home/ktyc/meanjs/node_modules/mongodb-core/lib/auth/x509.js
/home/ktyc/meanjs/node_modules/mongodb-core/lib/auth/plain.js
/home/ktyc/meanjs/node_modules/mongodb-core/lib/auth/mongocr.js
/home/ktyc/meanjs/node_modules/mongodb-core/lib/auth/sspi.js
/home/ktyc/meanjs/node_modules/mongodb-core/lib/cursor.js
/home/ktyc/meanjs/node_modules/mongodb-core/lib/connection/logger.js
/home/ktyc/meanjs/node_modules/mongodb-core/lib/connection/connection.js
/home/ktyc/meanjs/node_modules/mongodb-core/lib/connection/pool.js
/home/ktyc/meanjs/node_modules/mongodb-core/lib/wireprotocol/shared.js
/home/ktyc/meanjs/node_modules/mongodb-core/lib/wireprotocol/2_4_support.js
/home/ktyc/meanjs/node_modules/mongodb-core/lib/wireprotocol/3_2_support.js
/home/ktyc/meanjs/node_modules/mongodb-core/lib/wireprotocol/commands.js
/home/ktyc/meanjs/node_modules/mongodb-core/lib/wireprotocol/2_6_support.js
/home/ktyc/meanjs/node_modules/mongodb-core/lib/topologies/shared.js
/home/ktyc/meanjs/node_modules/mongodb-core/lib/topologies/server.js
/home/ktyc/meanjs/node_modules/mongodb-core/lib/topologies/read_preference.js
/home/ktyc/meanjs/node_modules/mongodb-core/lib/topologies/replset.js
/home/ktyc/meanjs/node_modules/mongodb-core/lib/topologies/mongos.js
/home/ktyc/meanjs/node_modules/mongodb-core/lib/topologies/replset_state.js
/home/ktyc/meanjs/node_modules/mongodb-core/lib/error.js
/home/ktyc/meanjs/node_modules/mongodb-core/README.md
/home/ktyc/meanjs/node_modules/mongodb-core/package.json
/home/ktyc/meanjs/node_modules/mongodb-core/HISTORY.md
/home/ktyc/meanjs/node_modules/bluebird/package.json
/home/ktyc/meanjs/node_modules/phantomjs-prebuilt/lib/phantom/bin/phantomjs
/home/ktyc/meanjs/node_modules/phantomjs-prebuilt/lib/phantom/third-party.txt
/home/ktyc/meanjs/node_modules/eslint/conf/environments.js
/home/ktyc/meanjs/node_modules/bson/browser_build/bson.js
/home/ktyc/meanjs/node_modules/bson/bower.json
/home/ktyc/meanjs/node_modules/bson/lib/bson/timestamp.js
/home/ktyc/meanjs/node_modules/bson/README.md
/home/ktyc/meanjs/node_modules/bson/package.json
/home/ktyc/meanjs/node_modules/bson/HISTORY.md
/home/ktyc/meanjs/node_modules/sliced/package.json
/home/ktyc/meanjs/node_modules/require_optional/package.json
/home/ktyc/meanjs/node_modules/express-session/README.md
/home/ktyc/meanjs/node_modules/gulp-eslint/node_modules/eslint/conf/environments                                                                                                                                                    .js
/home/ktyc/meanjs/node_modules/gulp-eslint/node_modules/globals/globals.json
/home/ktyc/meanjs/node_modules/mpath/README.md
/home/ktyc/meanjs/node_modules/mpath/package.json
/home/ktyc/meanjs/node_modules/mongoose/CONTRIBUTING.md
/home/ktyc/meanjs/node_modules/mongoose/node_modules/mongodb-core/conf.json
/home/ktyc/meanjs/node_modules/mongoose/node_modules/mongodb-core/connect_test.j                                                                                                                                                    s
/home/ktyc/meanjs/node_modules/mongoose/node_modules/mongodb-core/test34.js
/home/ktyc/meanjs/node_modules/mongoose/node_modules/mongodb-core/TESTING.md
/home/ktyc/meanjs/node_modules/mongoose/node_modules/mongodb-core/test1.js
/home/ktyc/meanjs/node_modules/mongoose/node_modules/mongodb-core/index.js
/home/ktyc/meanjs/node_modules/mongoose/node_modules/mongodb-core/THIRD-PARTY-NO                                                                                                                                                    TICES
/home/ktyc/meanjs/node_modules/mongoose/node_modules/mongodb-core/yarn.lock
/home/ktyc/meanjs/node_modules/mongoose/node_modules/mongodb-core/lib/auth/gssap                                                                                                                                                    i.js
/home/ktyc/meanjs/node_modules/mongoose/node_modules/mongodb-core/lib/auth/scram                                                                                                                                                    .js
/home/ktyc/meanjs/node_modules/mongoose/node_modules/mongodb-core/lib/auth/x509.                                                                                                                                                    js
/home/ktyc/meanjs/node_modules/mongoose/node_modules/mongodb-core/lib/auth/plain                                                                                                                                                    .js
/home/ktyc/meanjs/node_modules/mongoose/node_modules/mongodb-core/lib/auth/mongo                                                                                                                                                    cr.js
/home/ktyc/meanjs/node_modules/mongoose/node_modules/mongodb-core/lib/auth/sspi.                                                                                                                                                    js
/home/ktyc/meanjs/node_modules/mongoose/node_modules/mongodb-core/lib/cursor.js
/home/ktyc/meanjs/node_modules/mongoose/node_modules/mongodb-core/lib/connection                                                                                                                                                    /logger.js
/home/ktyc/meanjs/node_modules/mongoose/node_modules/mongodb-core/lib/connection                                                                                                                                                    /connection.js
/home/ktyc/meanjs/node_modules/mongoose/node_modules/mongodb-core/lib/connection                                                                                                                                                    /pool.js
/home/ktyc/meanjs/node_modules/mongoose/node_modules/mongodb-core/lib/wireprotoc                                                                                                                                                    ol/shared.js
/home/ktyc/meanjs/node_modules/mongoose/node_modules/mongodb-core/lib/wireprotoc                                                                                                                                                    ol/2_4_support.js
/home/ktyc/meanjs/node_modules/mongoose/node_modules/mongodb-core/lib/wireprotoc                                                                                                                                                    ol/3_2_support.js
/home/ktyc/meanjs/node_modules/mongoose/node_modules/mongodb-core/lib/wireprotoc                                                                                                                                                    ol/commands.js
/home/ktyc/meanjs/node_modules/mongoose/node_modules/mongodb-core/lib/wireprotoc                                                                                                                                                    ol/2_6_support.js
/home/ktyc/meanjs/node_modules/mongoose/node_modules/mongodb-core/lib/topologies                                                                                                                                                    /shared.js
/home/ktyc/meanjs/node_modules/mongoose/node_modules/mongodb-core/lib/topologies                                                                                                                                                    /server.js
/home/ktyc/meanjs/node_modules/mongoose/node_modules/mongodb-core/lib/topologies                                                                                                                                                    /read_preference.js
/home/ktyc/meanjs/node_modules/mongoose/node_modules/mongodb-core/lib/topologies                                                                                                                                                    /replset.js
/home/ktyc/meanjs/node_modules/mongoose/node_modules/mongodb-core/lib/topologies                                                                                                                                                    /mongos.js
/home/ktyc/meanjs/node_modules/mongoose/node_modules/mongodb-core/lib/topologies                                                                                                                                                    /replset_state.js
/home/ktyc/meanjs/node_modules/mongoose/node_modules/mongodb-core/lib/error.js
/home/ktyc/meanjs/node_modules/mongoose/node_modules/mongodb-core/README.md
/home/ktyc/meanjs/node_modules/mongoose/node_modules/mongodb-core/package.json
/home/ktyc/meanjs/node_modules/mongoose/node_modules/mongodb-core/HISTORY.md
/home/ktyc/meanjs/node_modules/mongoose/node_modules/async/package.json
/home/ktyc/meanjs/node_modules/mongoose/node_modules/mongodb/conf.json
/home/ktyc/meanjs/node_modules/mongoose/node_modules/mongodb/insert_bench.js
/home/ktyc/meanjs/node_modules/mongoose/node_modules/mongodb/index.js
/home/ktyc/meanjs/node_modules/mongoose/node_modules/mongodb/THIRD-PARTY-NOTICE
/home/ktyc/meanjs/node_modules/mongoose/node_modules/mongodb/yarn.lock
/home/ktyc/meanjs/node_modules/mongoose/node_modules/mongodb/lib/cursor.js
/home/ktyc/meanjs/node_modules/mongoose/node_modules/mongodb/lib/bulk/ordered.j
/home/ktyc/meanjs/node_modules/mongoose/node_modules/mongodb/lib/bulk/unordered.                                                                                                                                                    js
/home/ktyc/meanjs/node_modules/mongoose/node_modules/mongodb/lib/bulk/common.js
/home/ktyc/meanjs/node_modules/mongoose/node_modules/mongodb/lib/authenticate.j
/home/ktyc/meanjs/node_modules/mongoose/node_modules/mongodb/lib/topology_base.j                                                                                                                                                    s
/home/ktyc/meanjs/node_modules/mongoose/node_modules/mongodb/lib/mongo_client.j
/home/ktyc/meanjs/node_modules/mongoose/node_modules/mongodb/lib/db.js
/home/ktyc/meanjs/node_modules/mongoose/node_modules/mongodb/lib/aggregation_cur                                                                                                                                                    sor.js
/home/ktyc/meanjs/node_modules/mongoose/node_modules/mongodb/lib/command_cursor.                                                                                                                                                    js
/home/ktyc/meanjs/node_modules/mongoose/node_modules/mongodb/lib/utils.js
/home/ktyc/meanjs/node_modules/mongoose/node_modules/mongodb/lib/gridfs-stream/u                                                                                                                                                    pload.js
/home/ktyc/meanjs/node_modules/mongoose/node_modules/mongodb/lib/gridfs-stream/i                                                                                                                                                    ndex.js
/home/ktyc/meanjs/node_modules/mongoose/node_modules/mongodb/lib/gridfs/chunk.j
/home/ktyc/meanjs/node_modules/mongoose/node_modules/mongodb/lib/gridfs/grid_sto                                                                                                                                                    re.js
/home/ktyc/meanjs/node_modules/mongoose/node_modules/mongodb/lib/collection.js
/home/ktyc/meanjs/node_modules/mongoose/node_modules/mongodb/lib/server.js
/home/ktyc/meanjs/node_modules/mongoose/node_modules/mongodb/lib/read_preference                                                                                                                                                    .js
/home/ktyc/meanjs/node_modules/mongoose/node_modules/mongodb/lib/url_parser.js
/home/ktyc/meanjs/node_modules/mongoose/node_modules/mongodb/lib/replset.js
/home/ktyc/meanjs/node_modules/mongoose/node_modules/mongodb/lib/mongos.js
/home/ktyc/meanjs/node_modules/mongoose/node_modules/mongodb/lib/admin.js
/home/ktyc/meanjs/node_modules/mongoose/node_modules/mongodb/README.md
/home/ktyc/meanjs/node_modules/mongoose/node_modules/mongodb/package.json
/home/ktyc/meanjs/node_modules/mongoose/node_modules/mongodb/HISTORY.md
/home/ktyc/meanjs/node_modules/mongoose/node_modules/mongodb/boot_auth.js
/home/ktyc/meanjs/node_modules/mongoose/examples/aggregate/aggregate.js
/home/ktyc/meanjs/node_modules/mongoose/examples/aggregate/person.js
/home/ktyc/meanjs/node_modules/mongoose/examples/globalschemas/gs_example.js
/home/ktyc/meanjs/node_modules/mongoose/examples/globalschemas/person.js
/home/ktyc/meanjs/node_modules/mongoose/examples/querybuilder/querybuilder.js
/home/ktyc/meanjs/node_modules/mongoose/examples/querybuilder/person.js
/home/ktyc/meanjs/node_modules/mongoose/examples/statics/person.js
/home/ktyc/meanjs/node_modules/mongoose/examples/statics/statics.js
/home/ktyc/meanjs/node_modules/mongoose/examples/doc-methods.js
/home/ktyc/meanjs/node_modules/mongoose/examples/population/population-of-multip                                                                                                                                                    le-existing-docs.js
/home/ktyc/meanjs/node_modules/mongoose/examples/population/population-plain-obj                                                                                                                                                    ects.js
/home/ktyc/meanjs/node_modules/mongoose/examples/population/population-basic.js
/home/ktyc/meanjs/node_modules/mongoose/examples/population/population-across-th                                                                                                                                                    ree-collections.js
/home/ktyc/meanjs/node_modules/mongoose/examples/population/population-options.j                                                                                                                                                    s
/home/ktyc/meanjs/node_modules/mongoose/examples/population/population-of-existi                                                                                                                                                    ng-doc.js
/home/ktyc/meanjs/node_modules/mongoose/examples/mapreduce/mapreduce.js
/home/ktyc/meanjs/node_modules/mongoose/examples/mapreduce/person.js
/home/ktyc/meanjs/node_modules/mongoose/examples/express/connection-sharing/app.                                                                                                                                                    js
/home/ktyc/meanjs/node_modules/mongoose/examples/express/README.md
/home/ktyc/meanjs/node_modules/mongoose/examples/promises/promise.js
/home/ktyc/meanjs/node_modules/mongoose/examples/promises/person.js
/home/ktyc/meanjs/node_modules/mongoose/examples/schema/schema.js
/home/ktyc/meanjs/node_modules/mongoose/examples/schema/storing-schemas-as-json/                                                                                                                                                    index.js
/home/ktyc/meanjs/node_modules/mongoose/examples/lean/lean.js
/home/ktyc/meanjs/node_modules/mongoose/examples/lean/person.js
/home/ktyc/meanjs/node_modules/mongoose/examples/replicasets/person.js
/home/ktyc/meanjs/node_modules/mongoose/examples/replicasets/replica-sets.js
/home/ktyc/meanjs/node_modules/mongoose/examples/README.md
/home/ktyc/meanjs/node_modules/mongoose/examples/geospatial/geoJSONexample.js
/home/ktyc/meanjs/node_modules/mongoose/examples/geospatial/geoJSONSchema.js
/home/ktyc/meanjs/node_modules/mongoose/examples/geospatial/geospatial.js
/home/ktyc/meanjs/node_modules/mongoose/examples/geospatial/person.js
/home/ktyc/meanjs/node_modules/mongoose/.travis.yml
/home/ktyc/meanjs/node_modules/mongoose/index.js
/home/ktyc/meanjs/node_modules/mongoose/.github/ISSUE_TEMPLATE.md
/home/ktyc/meanjs/node_modules/mongoose/lib/error/browserMissingSchema.js
/home/ktyc/meanjs/node_modules/mongoose/lib/error/objectExpected.js
/home/ktyc/meanjs/node_modules/mongoose/lib/error/missingSchema.js
/home/ktyc/meanjs/node_modules/mongoose/lib/error/version.js
/home/ktyc/meanjs/node_modules/mongoose/lib/error/strict.js
/home/ktyc/meanjs/node_modules/mongoose/lib/error/validator.js
/home/ktyc/meanjs/node_modules/mongoose/lib/error/notFound.js
/home/ktyc/meanjs/node_modules/mongoose/lib/error/validation.js
/home/ktyc/meanjs/node_modules/mongoose/lib/error/overwriteModel.js
/home/ktyc/meanjs/node_modules/mongoose/lib/error/disconnected.js
/home/ktyc/meanjs/node_modules/mongoose/lib/error/messages.js
/home/ktyc/meanjs/node_modules/mongoose/lib/error/divergentArray.js
/home/ktyc/meanjs/node_modules/mongoose/lib/error/cast.js
/home/ktyc/meanjs/node_modules/mongoose/lib/schema.js
/home/ktyc/meanjs/node_modules/mongoose/lib/connection.js
/home/ktyc/meanjs/node_modules/mongoose/lib/aggregate.js
/home/ktyc/meanjs/node_modules/mongoose/lib/browserDocument.js
/home/ktyc/meanjs/node_modules/mongoose/lib/queryhelpers.js
/home/ktyc/meanjs/node_modules/mongoose/lib/promise.js
/home/ktyc/meanjs/node_modules/mongoose/lib/utils.js
/home/ktyc/meanjs/node_modules/mongoose/lib/drivers/browser/objectid.js
/home/ktyc/meanjs/node_modules/mongoose/lib/drivers/index.js
/home/ktyc/meanjs/node_modules/mongoose/lib/drivers/node-mongodb-native/connecti                                                                                                                                                    on.js
/home/ktyc/meanjs/node_modules/mongoose/lib/drivers/node-mongodb-native/objectid                                                                                                                                                    .js
/home/ktyc/meanjs/node_modules/mongoose/lib/drivers/node-mongodb-native/collecti                                                                                                                                                    on.js
/home/ktyc/meanjs/node_modules/mongoose/lib/drivers/node-mongodb-native/ReadPref                                                                                                                                                    erence.js
/home/ktyc/meanjs/node_modules/mongoose/lib/drivers/node-mongodb-native/binary.j                                                                                                                                                    s
/home/ktyc/meanjs/node_modules/mongoose/lib/index.js
/home/ktyc/meanjs/node_modules/mongoose/lib/cursor/AggregationCursor.js
/home/ktyc/meanjs/node_modules/mongoose/lib/cursor/QueryCursor.js
/home/ktyc/meanjs/node_modules/mongoose/lib/query.js
/home/ktyc/meanjs/node_modules/mongoose/lib/virtualtype.js
/home/ktyc/meanjs/node_modules/mongoose/lib/ES6Promise.js
/home/ktyc/meanjs/node_modules/mongoose/lib/collection.js
/home/ktyc/meanjs/node_modules/mongoose/lib/document.js
/home/ktyc/meanjs/node_modules/mongoose/lib/schema/string.js
/home/ktyc/meanjs/node_modules/mongoose/lib/schema/array.js
/home/ktyc/meanjs/node_modules/mongoose/lib/schema/documentarray.js
/home/ktyc/meanjs/node_modules/mongoose/lib/schema/buffer.js
/home/ktyc/meanjs/node_modules/mongoose/lib/schema/embedded.js
/home/ktyc/meanjs/node_modules/mongoose/lib/schema/number.js
/home/ktyc/meanjs/node_modules/mongoose/lib/schema/date.js
/home/ktyc/meanjs/node_modules/mongoose/lib/services/updateValidators.js
/home/ktyc/meanjs/node_modules/mongoose/lib/services/setDefaultsOnInsert.js
/home/ktyc/meanjs/node_modules/mongoose/lib/services/query/castUpdate.js
/home/ktyc/meanjs/node_modules/mongoose/lib/services/common.js
/home/ktyc/meanjs/node_modules/mongoose/lib/types/subdocument.js
/home/ktyc/meanjs/node_modules/mongoose/lib/types/decimal128.js
/home/ktyc/meanjs/node_modules/mongoose/lib/types/objectid.js
/home/ktyc/meanjs/node_modules/mongoose/lib/types/array.js
/home/ktyc/meanjs/node_modules/mongoose/lib/types/documentarray.js
/home/ktyc/meanjs/node_modules/mongoose/lib/types/buffer.js
/home/ktyc/meanjs/node_modules/mongoose/lib/types/embedded.js
/home/ktyc/meanjs/node_modules/mongoose/lib/model.js
/home/ktyc/meanjs/node_modules/mongoose/lib/querystream.js
/home/ktyc/meanjs/node_modules/mongoose/lib/plugins/sharding.js
/home/ktyc/meanjs/node_modules/mongoose/lib/schematype.js
/home/ktyc/meanjs/node_modules/mongoose/lib/browser.js
/home/ktyc/meanjs/node_modules/mongoose/lib/cast.js
/home/ktyc/meanjs/node_modules/mongoose/lib/error.js
/home/ktyc/meanjs/node_modules/mongoose/tools/repl.js
/home/ktyc/meanjs/node_modules/mongoose/tools/sharded.js
/home/ktyc/meanjs/node_modules/mongoose/README.md
/home/ktyc/meanjs/node_modules/mongoose/release-items.md
/home/ktyc/meanjs/node_modules/mongoose/package.json
/home/ktyc/meanjs/node_modules/mongoose/History.md
/home/ktyc/meanjs/node_modules/readable-stream/package.json
/home/ktyc/meanjs/node_modules/acl/Readme.md
/home/ktyc/meanjs/node_modules/acl/.travis.yml
/home/ktyc/meanjs/node_modules/acl/index.js
/home/ktyc/meanjs/node_modules/acl/lib/mongodb-backend.js
/home/ktyc/meanjs/node_modules/acl/package.json
/home/ktyc/meanjs/node_modules/acl/coverage/lcov-report/node_acl/index.js.html
/home/ktyc/meanjs/node_modules/acl/coverage/lcov-report/node_acl/lib/mongodb-bac                                                                                                                                                    kend.js.html
/home/ktyc/meanjs/node_modules/acl/coverage/lcov-report/node_acl/lib/index.html
/home/ktyc/meanjs/node_modules/acl/coverage/lcov.info
/home/ktyc/meanjs/node_modules/acl/coverage/coverage.json
/home/ktyc/meanjs/node_modules/acl/test/runner.js
/home/ktyc/meanjs/node_modules/hooks-fixed/package.json
/home/ktyc/meanjs/node_modules/connect-mongo/.travis.yml
/home/ktyc/meanjs/node_modules/connect-mongo/src/index.js
/home/ktyc/meanjs/node_modules/connect-mongo/CHANGELOG.md
/home/ktyc/meanjs/node_modules/connect-mongo/README.md
/home/ktyc/meanjs/node_modules/connect-mongo/package.json
/home/ktyc/meanjs/node_modules/connect-mongo/src-es5/index.js
/home/ktyc/meanjs/node_modules/superagent/node_modules/form-data/wercker.yml
/home/ktyc/meanjs/node_modules/muri/lib/index.js
/home/ktyc/meanjs/node_modules/muri/README.md
/home/ktyc/meanjs/node_modules/muri/package.json
/home/ktyc/meanjs/node_modules/muri/History.md
/home/ktyc/meanjs/node_modules/muri/test/index.js
/home/ktyc/meanjs/node_modules/kareem/package.json
/home/ktyc/meanjs/node_modules/es6-promise/package.json
/home/ktyc/meanjs/node_modules/ajv/dist/regenerator.min.js
/home/ktyc/meanjs/node_modules/mongodb/conf.json
/home/ktyc/meanjs/node_modules/mongodb/insert_bench.js
/home/ktyc/meanjs/node_modules/mongodb/index.js
/home/ktyc/meanjs/node_modules/mongodb/THIRD-PARTY-NOTICES
/home/ktyc/meanjs/node_modules/mongodb/yarn.lock
/home/ktyc/meanjs/node_modules/mongodb/lib/cursor.js
/home/ktyc/meanjs/node_modules/mongodb/lib/bulk/ordered.js
/home/ktyc/meanjs/node_modules/mongodb/lib/bulk/unordered.js
/home/ktyc/meanjs/node_modules/mongodb/lib/bulk/common.js
/home/ktyc/meanjs/node_modules/mongodb/lib/authenticate.js
/home/ktyc/meanjs/node_modules/mongodb/lib/topology_base.js
/home/ktyc/meanjs/node_modules/mongodb/lib/mongo_client.js
/home/ktyc/meanjs/node_modules/mongodb/lib/db.js
/home/ktyc/meanjs/node_modules/mongodb/lib/aggregation_cursor.js
/home/ktyc/meanjs/node_modules/mongodb/lib/command_cursor.js
/home/ktyc/meanjs/node_modules/mongodb/lib/utils.js
/home/ktyc/meanjs/node_modules/mongodb/lib/gridfs-stream/download.js
/home/ktyc/meanjs/node_modules/mongodb/lib/gridfs-stream/upload.js
/home/ktyc/meanjs/node_modules/mongodb/lib/gridfs-stream/index.js
/home/ktyc/meanjs/node_modules/mongodb/lib/gridfs/chunk.js
/home/ktyc/meanjs/node_modules/mongodb/lib/gridfs/grid_store.js
/home/ktyc/meanjs/node_modules/mongodb/lib/collection.js
/home/ktyc/meanjs/node_modules/mongodb/lib/server.js
/home/ktyc/meanjs/node_modules/mongodb/lib/read_preference.js
/home/ktyc/meanjs/node_modules/mongodb/lib/url_parser.js
/home/ktyc/meanjs/node_modules/mongodb/lib/replset.js
/home/ktyc/meanjs/node_modules/mongodb/lib/mongos.js
/home/ktyc/meanjs/node_modules/mongodb/lib/admin.js
/home/ktyc/meanjs/node_modules/mongodb/README.md
/home/ktyc/meanjs/node_modules/mongodb/package.json
/home/ktyc/meanjs/node_modules/mongodb/HISTORY.md
/home/ktyc/meanjs/node_modules/mongodb/boot_auth.js
/home/ktyc/meanjs/node_modules/regexp-clone/package.json
/home/ktyc/meanjs/node_modules/mquery/node_modules/bluebird/changelog.md
/home/ktyc/meanjs/node_modules/mquery/.travis.yml
/home/ktyc/meanjs/node_modules/mquery/lib/utils.js
/home/ktyc/meanjs/node_modules/mquery/lib/collection/index.js
/home/ktyc/meanjs/node_modules/mquery/lib/env.js
/home/ktyc/meanjs/node_modules/mquery/lib/mquery.js
/home/ktyc/meanjs/node_modules/mquery/README.md
/home/ktyc/meanjs/node_modules/mquery/package.json
/home/ktyc/meanjs/node_modules/mquery/History.md
/home/ktyc/meanjs/node_modules/mquery/test/index.js
/home/ktyc/meanjs/node_modules/mquery/test/collection/node.js
/home/ktyc/meanjs/node_modules/mquery/test/utils.test.js
/home/ktyc/meanjs/node_modules/mquery/test/env.js
/home/ktyc/meanjs/node_modules/winston/CHANGELOG.md
/home/ktyc/meanjs/node_modules/winston/README.md
/home/ktyc/meanjs/node_modules/globals/globals.json
/home/ktyc/meanjs/node_modules/lodash/package.json
/home/ktyc/meanjs/node_modules/caniuse-db/region-usage-json/MN.json
/home/ktyc/meanjs/node_modules/caniuse-db/region-usage-json/SA.json
/home/ktyc/meanjs/node_modules/is-url/test/index.js
/home/ktyc/meanjs/node_modules/mpromise/README.md
/home/ktyc/meanjs/node_modules/mpromise/package.json
/home/ktyc/meanjs/node_modules/ms/package.json
/home/ktyc/meanjs/node_modules/busboy/deps/encoding/encoding-indexes.js
/home/ktyc/meanjs/node_modules/validator/validator.min.js
/home/ktyc/meanjs/node_modules/validator/validator.js
/home/ktyc/meanjs/node_modules/validator/index.js
/home/ktyc/meanjs/node_modules/validator/lib/isMongoId.js
/home/ktyc/meanjs/node_modules/validator/README.md
/home/ktyc/meanjs/.git/index
/home/ktyc/meanjs/docker-compose-production.yml
/home/ktyc/meanjs/UPGRADE.md
/home/ktyc/meanjs/modules/core/tests/server/core.server.config.tests.js
/home/ktyc/meanjs/modules/core/client/views/home.client.view.html
/home/ktyc/meanjs/modules/core/server/controllers/errors.server.controller.js
/home/ktyc/meanjs/modules/users/tests/server/user.server.model.tests.js
/home/ktyc/meanjs/modules/users/tests/server/user.server.routes.tests.js
/home/ktyc/meanjs/modules/users/server/models/user.server.model.js
/home/ktyc/meanjs/modules/users/server/config/strategies/local.js
/home/ktyc/meanjs/modules/users/server/config/users.server.config.js
/home/ktyc/meanjs/modules/users/server/controllers/users/users.authorization.server.controller.js
/home/ktyc/meanjs/modules/users/server/controllers/users/users.authentication.server.controller.js
/home/ktyc/meanjs/modules/users/server/controllers/users/users.profile.server.controller.js
/home/ktyc/meanjs/modules/users/server/controllers/users/users.password.server.controller.js
/home/ktyc/meanjs/modules/users/server/controllers/admin.server.controller.js
/home/ktyc/meanjs/modules/articles/tests/server/article.server.model.tests.js
/home/ktyc/meanjs/modules/articles/tests/server/admin.article.server.routes.tests.js
/home/ktyc/meanjs/modules/articles/tests/server/article.server.routes.tests.js
/home/ktyc/meanjs/modules/articles/server/models/article.server.model.js
/home/ktyc/meanjs/modules/articles/server/controllers/articles.server.controller.js
/home/ktyc/meanjs/.gitignore
/home/ktyc/meanjs/config/env/local.example.js
/home/ktyc/meanjs/config/env/test.js
/home/ktyc/meanjs/config/env/production.js
/home/ktyc/meanjs/config/env/local-development.js
/home/ktyc/meanjs/config/env/default.js
/home/ktyc/meanjs/config/env/development.js
/home/ktyc/meanjs/config/lib/mongoose.js
/home/ktyc/meanjs/config/lib/socket.io.js
/home/ktyc/meanjs/config/lib/seed.js
/home/ktyc/meanjs/config/lib/express.js
/home/ktyc/meanjs/config/lib/app.js
/home/ktyc/meanjs/.travis.yml
/home/ktyc/meanjs/docker-compose.yml
/home/ktyc/meanjs/CHANGELOG.md
/home/ktyc/meanjs/manifest.yml
/home/ktyc/meanjs/bower.json
/home/ktyc/meanjs/gulpfile.js
/home/ktyc/meanjs/scripts/upgrade-users-sparse-index.js
/home/ktyc/meanjs/scripts/reset-password.js
/home/ktyc/meanjs/README.md
/home/ktyc/meanjs/package.json
  • Have a look in all the files within /home/ktyc/meanjs/config/ - it should have the database connection details.

I tested a few iterations before I get to this point..

After I execute

sudo nano /etc/mongod.conf

Then commented

#security:
#  authorization: "enabled"

All the mongo error went away.

After I execute

npm start

as per https://github.com/meanjs/mean
I get the Mean.js test page :)

I don't think this is the right way though.
So the problem is still not solved.
There has to be a better solution.

Anyway before I commented the mongod.conf.
It generated the errors below.

After I commented the mongod.conf, no more errors.


Unhandled rejection MongoError: not authorized on mean-dev to execute command {                                    listIndexes: "sessions", cursor: {} }
    at Function.MongoError.create (/home/ktyc/meanjs/node_modules/mongoose/node_                                   modules/mongodb-core/lib/error.js:31:11)
    at queryCallback (/home/ktyc/meanjs/node_modules/mongoose/node_modules/mongo                                   db-core/lib/cursor.js:212:36)
From previous event:
    at MongoStore.setAutoRemoveAsync (/home/ktyc/meanjs/node_modules/connect-mon                                   go/src/index.js:129:40)
    at MongoStore.handleNewConnectionAsync (/home/ktyc/meanjs/node_modules/conne                                   ct-mongo/src/index.js:121:18)
    at MongoStore (/home/ktyc/meanjs/node_modules/connect-mongo/src/index.js:89:                                   26)
    at Object.module.exports.initSession (/home/ktyc/meanjs/config/lib/express.j                                   s:120:12)
    at Object.module.exports.init (/home/ktyc/meanjs/config/lib/express.js:243:8                                   )
    at /home/ktyc/meanjs/config/lib/app.js:25:23
    at /home/ktyc/meanjs/config/lib/mongoose.js:38:15
    at /home/ktyc/meanjs/node_modules/mongoose/lib/connection.js:316:19
    at open (/home/ktyc/meanjs/node_modules/mongoose/lib/connection.js:682:17)
    at NativeConnection.Connection.onOpen (/home/ktyc/meanjs/node_modules/mongoo                                   se/lib/connection.js:692:5)
    at /home/ktyc/meanjs/node_modules/mongoose/lib/connection.js:652:11
    at /home/ktyc/meanjs/node_modules/mongoose/lib/drivers/node-mongodb-native/c                                   onnection.js:71:5
    at /home/ktyc/meanjs/node_modules/mongoose/node_modules/mongodb/lib/db.js:23                                   8:5
    at Server.connectHandler (/home/ktyc/meanjs/node_modules/mongoose/node_modul                                   es/mongodb/lib/server.js:339:7)
    at Server.g (events.js:292:16)
    at emitOne (events.js:96:13)
    at Server.emit (events.js:188:7)
    at /home/ktyc/meanjs/node_modules/mongoose/node_modules/mongodb-core/lib/top                                   ologies/server.js:299:14
    at /home/ktyc/meanjs/node_modules/mongoose/node_modules/mongodb-core/lib/con                                   nection/pool.js:469:18
    at _combinedTickCallback (internal/process/next_tick.js:73:7)
    at process._tickCallback (internal/process/next_tick.js:104:9)

Unhandled rejection MongoError: not authorized on mean-dev to execute command {                                    listIndexes: "sessions", cursor: {} }
    at Function.MongoError.create (/home/ktyc/meanjs/node_modules/mongoose/node_                                   modules/mongodb-core/lib/error.js:31:11)
    at queryCallback (/home/ktyc/meanjs/node_modules/mongoose/node_modules/mongo                                   db-core/lib/cursor.js:212:36)
From previous event:
    at MongoStore.setAutoRemoveAsync (/home/ktyc/meanjs/node_modules/connect-mon                                   go/src/index.js:129:40)
    at MongoStore.handleNewConnectionAsync (/home/ktyc/meanjs/node_modules/conne                                   ct-mongo/src/index.js:121:18)
    at MongoStore (/home/ktyc/meanjs/node_modules/connect-mongo/src/index.js:89:                                   26)
    at module.exports (/home/ktyc/meanjs/config/lib/socket.io.js:73:20)
    at Object.module.exports.configureSocketIO (/home/ktyc/meanjs/config/lib/exp                                   ress.js:214:38)
    at Object.module.exports.init (/home/ktyc/meanjs/config/lib/express.js:258:1                                   4)
    at /home/ktyc/meanjs/config/lib/app.js:25:23
    at /home/ktyc/meanjs/config/lib/mongoose.js:38:15
    at /home/ktyc/meanjs/node_modules/mongoose/lib/connection.js:316:19
    at open (/home/ktyc/meanjs/node_modules/mongoose/lib/connection.js:682:17)
    at NativeConnection.Connection.onOpen (/home/ktyc/meanjs/node_modules/mongoo                                   se/lib/connection.js:692:5)
    at /home/ktyc/meanjs/node_modules/mongoose/lib/connection.js:652:11
    at /home/ktyc/meanjs/node_modules/mongoose/lib/drivers/node-mongodb-native/c                                   onnection.js:71:5
    at /home/ktyc/meanjs/node_modules/mongoose/node_modules/mongodb/lib/db.js:23                                   8:5
    at Server.connectHandler (/home/ktyc/meanjs/node_modules/mongoose/node_modul                                   es/mongodb/lib/server.js:339:7)
    at Server.g (events.js:292:16)
    at emitOne (events.js:96:13)
    at Server.emit (events.js:188:7)
    at /home/ktyc/meanjs/node_modules/mongoose/node_modules/mongodb-core/lib/top                                   ologies/server.js:299:14
    at /home/ktyc/meanjs/node_modules/mongoose/node_modules/mongodb-core/lib/con                                   nection/pool.js:469:18
    at _combinedTickCallback (internal/process/next_tick.js:73:7)
    at process._tickCallback (internal/process/next_tick.js:104:9)

Have another answer? Share your knowledge.