Question

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

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/node_modules/tiny-lr/node_modules npm WARN checkPermissions Missing write access to /opt/mean/node_modules/tiny-lr/node_modules/body-parser/node_modules npm WARN checkPermissions Missing write access to /opt/mean/node_modules/tiny-lr/node_modules/raw-body/node_modules 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/node_modules/tiny-lr/node_modules npm ERR! code EACCES npm ERR! errno -13 npm ERR! syscall access npm ERR! Error: EACCES: permission denied, access ‘/opt/mean/node_modules/tiny-lr/node_modules’ npm ERR! at Error (native) npm ERR! { Error: EACCES: permission denied, access ‘/opt/mean/node_modules/tiny-lr/node_modules’ npm ERR! at Error (native) npm ERR! errno: -13, npm ERR! code: ‘EACCES’, npm ERR! syscall: ‘access’, npm ERR! path: ‘/opt/mean/node_modules/tiny-lr/node_modules’ } 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-17T08_43_13_072Z-debug.log

This is my second droplet try.

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

Subscribe
Share

Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

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)

@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

@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

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

@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"
                }
        ]
}

@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)

@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 (node_modules/ch okidar/node_modules/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$

@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//* .nyc_output .sass-cac he bower_components 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/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: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/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: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/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)

@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

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.