Report this

What is the reason for this report?

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

Posted on June 17, 2017

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.



This textbox defaults to using Markdown to format your 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.

@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

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

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.