GithubHelp home page GithubHelp logo

Comments (8)

fnkr avatar fnkr commented on July 19, 2024

Found the reason: install.js adds /usr/local/lib/node_modules to $PATH, however, I'm using nvm so the correct path is /home/ubuntu/.nvm/v0.10.41/lib/node_modules.

from ircanywhere.

MatFluor avatar MatFluor commented on July 19, 2024

I have the same problem on Debian (Turnkey Nodejs appliance). Tried with and without nvm (including the workaround from @fnkr) but it did not work; neither on Node 0.10.41 nor on nodejs 12.7.

Tried the same from a basic Ubuntu 14 Container, installed node/npm via nvm (as suggested in the docs). Same error with and without fix.

Am I missing something here?

from ircanywhere.

 avatar commented on July 19, 2024

Bad code. Some of my code was merged without testing.

from ircanywhere.

labsin avatar labsin commented on July 19, 2024

Also get this error. Can this be reopened?

from ircanywhere.

mikrobyte avatar mikrobyte commented on July 19, 2024

Having the same issue :(

leo@h2529749:/opt/ircanywhere$ sudo ./install.sh
[sudo] password for leo: 

/opt/ircanywhere/install.js:201
    function waitForRsInitiated(db, originalResult, waittime=30) {
                                                            ^
SyntaxError: Unexpected token =
    at Module._compile (module.js:439:25)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)
    at node.js:935:3

leo@h2529749:/opt/ircanywhere$ ls /usr/local/lib/node_modules/
nave  npm  pm2

from ircanywhere.

seirl avatar seirl commented on July 19, 2024

What's the status on this? Is there a way to quick-fix it?

from ircanywhere.

 avatar commented on July 19, 2024

Quick? Revert my patch.
I'll leave this here, though, because it removes syntax errors.

--- a/install.js
+++ b/install.js
@@ -188,7 +188,7 @@ function isMongoRunning(isGlobal, path) {

                db.command({replSetInitiate: null}, function(err, result) {
                        if (err === null || (result !== null && result.ok === 1)) {
-                               waitForRsInitiated(db, result);
+                               waitForRsInitiated(db, result, 30);
                        } else {
                                console.log(err, result);
                                console.log(COLOUR.red, 'rs.initiate() failed. Needs manual intervention.');
@@ -198,20 +198,17 @@ function isMongoRunning(isGlobal, path) {
        }

        // waittime is in seconds
-       function waitForRsInitiated(db, originalResult, waittime=30) {
-               waittime = waittime * 2 // check every half-second, so double the count
+       function waitForRsInitiated(db, originalResult, waittime) {
+               waittime = waittime * 2; // check every half-second, so double the count
+               success = 0;

                process.stdout.write(COLOUR.blue, 'Checking if the replica set is fully initiated...');
-               while (waittime => 0) {
-                       db.command({rs.status}, function(err, result) {
+               while (waittime > 0) {
+                       db.command({ 'rs.status': '' }, function(err, result) {
                                if (result.myState == 1) {
                                        process.stdout.write(' Success!\n');
-                                       break;
-                               } else if (waittime == 0) {
-                                       process.stdout.write('\n');
-                                       process.stdout.write(COLOUR.yellow, 'It appears that the mongodb replica set has not yet been initiated.');
-                                       process.stdout.write(COLOUR.yellow, 'MongoDB may magically correct this in seconds or minutes, but please be aware of this issue.');
-                                       break;
+                                       success = 1;
+                                       waittime = 0;
                                } else {
                                        waittime = waittime - 1;
                                        process.stdout.write('.');
@@ -219,6 +216,12 @@ function isMongoRunning(isGlobal, path) {
                                }
                        });
                }
+               if (success == 0) {
+                       process.stdout.write('\n');
+                       process.stdout.write(COLOUR.yellow, 'It appears that the mongodb replica set has not yet been initiated.');
+                       process.stdout.write(COLOUR.yellow, 'MongoDB may magically correct this in seconds or minutes, but');
+                       process.stdout.write(COLOUR.yellow, 'please be aware of this potential issue.');
+               }
                doneInstalling(db, originalResult);
        }

Of course, I still don't know if this will work. Particularly db.command({ 'rs.status': '' }, ..., because "selectors" aren't exactly documented. Pull request at your own risk. Last time I opened PR labeled 'untested code' it got accepted. Not going further down that rabbit hole.

from ircanywhere.

 avatar commented on July 19, 2024

Maybe {rs:{initiate}}, but I have no idea. rs.initiate() works when feeding it through the shell. Don't know how to do it from node.

from ircanywhere.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.