Welcome to Centmin Mod Community
Register Now

NodeBB npm: Command not found while installing nodebb.

Discussion in 'Forum software usage' started by harryneopotter, Mar 26, 2017.

Tags:
  1. harryneopotter

    harryneopotter Member

    70
    3
    8
    Aug 16, 2015
    Ratings:
    +8
    Local Time:
    9:44 AM
    Nginx 1.9.3
    MariaDB 10.0
    Hi,
    So I am following the Nodebb install guide :

    • Installed Passenger
    • Redis installed and running
    • Domain vhost setup
    • nodebb downloaded
    Now when I try to install it, I get this error :
    npm: command not found


    What to do ?

    Here is the output of nginx -V

    nginx.conf has passenger.conf included.

    so what am I doing wrong ?
     
  2. eva2000

    eva2000 Administrator Staff Member

    54,934
    12,240
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,812
    Local Time:
    2:14 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    guide for nodebb is outdated so probably differs from latest nodebb setups unfortunately i have no time to test newer nodebb setups.

    did you exit ssh session after install and re-login to ssh and try ?
    note on 123.09beta01 and newer no need to run addons/passenger.sh
    also what centmin mod version 123.08stable or 123.09beta01 ? as addons/nodejs.sh in 123.09beta01 is more improved
     
  3. eva2000

    eva2000 Administrator Staff Member

    54,934
    12,240
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,812
    Local Time:
    2:14 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Also ensure you have updated your Centmin Mod code on local server via centmin.sh menu option 23 submenu option 2. Getting Started Guide step 19 outlines also how to keep Centmin Mod code updated or how to switch version branches.

    Centmin Mod LEMP stack's script code is constantly updated for improvements, bug fixes and security fixes so keeping the Centmin Mod code up to date is important. With Centmin Mod 1.2.3-eva2000.08) (123.08stable) and higher releases, a newly added centmin.sh menu option 23 allows much easier code updates and version branch swicthing via Git backed environment you can setup. For full details read the following links:
     
  4. harryneopotter

    harryneopotter Member

    70
    3
    8
    Aug 16, 2015
    Ratings:
    +8
    Local Time:
    9:44 AM
    Nginx 1.9.3
    MariaDB 10.0
    I knew I was forgetting some info while creating the post. Here are the bits I left out by mistake :

    1. It is a fresh CMM installation (last week) with Centmin Mod 1.2.3-eva2000.08) (123.08stable)
    2. Yes, I logged out and logged in a few times already. No help.

    so instead of trying to fix this, should I try switching to the beta version and try then ?
    If its the latter, should I reinstall everything from scratch ?
     
  5. eva2000

    eva2000 Administrator Staff Member

    54,934
    12,240
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,812
    Local Time:
    2:14 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Probably easiest way if it's a fresh test server or server with data that can be recreated or reimported from backup
     
  6. harryneopotter

    harryneopotter Member

    70
    3
    8
    Aug 16, 2015
    Ratings:
    +8
    Local Time:
    9:44 AM
    Nginx 1.9.3
    MariaDB 10.0
    yeah, a completely fresh server as of now. Will do. Thanks :)
     
  7. harryneopotter

    harryneopotter Member

    70
    3
    8
    Aug 16, 2015
    Ratings:
    +8
    Local Time:
    9:44 AM
    Nginx 1.9.3
    MariaDB 10.0
    sigh..even a fresh installation (beta cmm + nodejs.sh) is giving new errors. getting frustrating.
     
  8. eva2000

    eva2000 Administrator Staff Member

    54,934
    12,240
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,812
    Local Time:
    2:14 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    what exact errors you getting ? unfortunately as I said the guide hasn't been tested/updated for new nodebb versions so your mileage will vary so up to you to figure out.
     
  9. harryneopotter

    harryneopotter Member

    70
    3
    8
    Aug 16, 2015
    Ratings:
    +8
    Local Time:
    9:44 AM
    Nginx 1.9.3
    MariaDB 10.0
    I followed the official guide this time. Looks like nodebb is not getting started.
     
  10. eva2000

    eva2000 Administrator Staff Member

    54,934
    12,240
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,812
    Local Time:
    2:14 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    i see might need to ask at Home | NodeBB

    one thing is if you use NodeBB with redis backend database, you need to make sure if you use redis caching for wordpress outlined at https://community.centminmod.com/threads/how-to-install-redis-server-on-centmin-mod-lemp-stack.4546/ that you do not set these options for using redis as LRU cache
    Code (Text):
    maxmemory 100mb
    maxmemory-policy allkeys-lru
    

    as that will tell redis to purge data once reaches 100MB in size and basically wipe out your redis data for nodebb

    also make sure nodebb isn't using default redis database 0 - IIRC nodebb install prompts for redis database number ? haven't checked in ages ? select a different redis database number from 0. Default has 0-15 database numbers for redis.
     
    Last edited: Apr 6, 2017
  11. eva2000

    eva2000 Administrator Staff Member

    54,934
    12,240
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,812
    Local Time:
    2:14 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
  12. harryneopotter

    harryneopotter Member

    70
    3
    8
    Aug 16, 2015
    Ratings:
    +8
    Local Time:
    9:44 AM
    Nginx 1.9.3
    MariaDB 10.0
    your last two posts and the new update is really helpful. Atleast nodebb is starting up now. But for some reason, the nginx proxy is not working. I can reach nodebb at domain.com:4567, but domain.com shows the default centmin page.

    include-nodebb.conf :

    Code:
     location ~ ^/(images|language|sounds|templates|uploads|vendor|src\/modules|nodebb\.min\.js|stylesheet\.css|admin\.css) {
            root /home/nginx/domains/domain.com/public/nodebb/public;
        }
    
        location /nodebb {
            root /home/nginx/domains/domain.com/public/nodebb/public;
            proxy_pass http://127.0.0.1:4567;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header Host $http_host;
            proxy_set_header X-NginX-Proxy true;
            proxy_redirect off;
    
            # Socket.IO Support
            proxy_http_version 1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection "upgrade";
        }
    nginx/conf/conf.d/domain.conf :

    Code:
    # Centmin Mod Getting Started Guide
    # must read http://centminmod.com/getstarted.html
    
    # redirect from non-www to www
    # uncomment, save file and restart Nginx to enable
    # if unsure use return 302 before using return 301
    #server {
    #            listen   80;
    #            server_name domain.com;
    #            return 301 $scheme://www.domain.com$request_uri;
    #       }
    
    server {
     
      server_name domain.com www.domain.com;
    
    # ngx_pagespeed & ngx_pagespeed handler
    #include /usr/local/nginx/conf/pagespeed.conf;
    #include /usr/local/nginx/conf/pagespeedhandler.conf;
    #include /usr/local/nginx/conf/pagespeedstatslog.conf;
    
      #add_header X-Frame-Options SAMEORIGIN;
      #add_header X-Xss-Protection "1; mode=block" always;
      #add_header X-Content-Type-Options "nosniff" always;
    
      # limit_conn limit_per_ip 16;
      # ssi  on;
    
      access_log /home/nginx/domains/domain.com/log/access.log main_ext buffer=256k flush=60m;
      error_log /home/nginx/domains/domain.com/log/error.log;
    
      include /usr/local/nginx/conf/autoprotect/domain.com/autoprotect-tdomain.com.conf;
      root /home/nginx/domains/domain.com/public;
      include /home/nginx/domains/domain.com/include-nodebb.conf;
      # uncomment cloudflare.conf include if using cloudflare for
      # server and/or vhost site
      include /usr/local/nginx/conf/cloudflare.conf;
      include /usr/local/nginx/conf/503include-main.conf;
    
      # prevent access to ./directories and files
      #location ~ (?:^|/)\. {
      # deny all;
      #}
    
      location / {
      include /usr/local/nginx/conf/503include-only.conf;
    
    # block common exploits, sql injections etc
    #include /usr/local/nginx/conf/block.conf;
    
      # Enables directory listings when index file not found
      #autoindex  on;
    
      # Shows file listing times as local time
      #autoindex_localtime on;
    
      # Enable for vBulletin usage WITHOUT vbSEO installed
      # More example Nginx vhost configurations at
      # http://centminmod.com/nginx_configure.html
      #try_files    $uri $uri/ /index.php;
    
      }
    
      #include /usr/local/nginx/conf/staticfiles.conf;
      include /usr/local/nginx/conf/php.conf;
      include /usr/local/nginx/conf/drop.conf;
      #include /usr/local/nginx/conf/errorpage.conf;
      include /usr/local/nginx/conf/vts_server.conf;
    }
    

    If I am not wrong, all the files have root as owner (domain.com/public and the include-nodebb.conf). Shouldnt they be owned by nginx ?
     
  13. eva2000

    eva2000 Administrator Staff Member

    54,934
    12,240
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,812
    Local Time:
    2:14 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    sorry i updated the vhost and include-nodebb.conf to use web root instead of /nodebb see 1st post at https://community.centminmod.com/threads/centmin-mod-nginx-nodebb-forum-install.4009/ for vhost and include-nodebb.conf

    Code (Text):
        location ~ ^/(images|language|sounds|templates|uploads|vendor|src\/modules|nodebb\.min\.js|stylesheet\.css|admin\.css) {
            root /home/nginx/domains/newdomain.com/public/nodebb/public;
        }
    
        location / {
            root /home/nginx/domains/newdomain.com/public/nodebb/public;
            proxy_pass http://127.0.0.1:4567;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header Host $http_host;
            proxy_set_header X-NginX-Proxy true;
            proxy_redirect off;
    
            # Socket.IO Support
            proxy_http_version 1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection "upgrade";
        }
    
    
     
  14. harryneopotter

    harryneopotter Member

    70
    3
    8
    Aug 16, 2015
    Ratings:
    +8
    Local Time:
    9:44 AM
    Nginx 1.9.3
    MariaDB 10.0
    Pardon the noobness, but I dont get your reply. I did check the first post and configured the above files accordingly. What am I doing wrong ?
     
  15. eva2000

    eva2000 Administrator Staff Member

    54,934
    12,240
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,812
    Local Time:
    2:14 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    might re-read as i edited the nginx vhost examples and removed the old location / root match and just use include-nodebb.conf instead
     
  16. harryneopotter

    harryneopotter Member

    70
    3
    8
    Aug 16, 2015
    Ratings:
    +8
    Local Time:
    9:44 AM
    Nginx 1.9.3
    MariaDB 10.0
    oh..my bad. That fixed it. Thanks a lot, George. You are such a life saver.