ArchiveSW - Display & Data Archive Storage

that looked better…

pi@archivesw:~ $ sudo npm install -g npm
/usr/bin/npx -> /usr/lib/node_modules/npm/bin/npx-cli.js
/usr/bin/npm -> /usr/lib/node_modules/npm/bin/npm-cli.js
+ npm@6.8.0
added 426 packages from 793 contributors in 40.278s
pi@archivesw:~ $
1 Like

Your system was really behind in updates.

Now run

sudo n stable

pi@archivesw:~ $ sudo npm install pm2 -g
/usr/bin/pm2 -> /usr/lib/node_modules/pm2/bin/pm2
/usr/bin/pm2-dev -> /usr/lib/node_modules/pm2/bin/pm2-dev
/usr/bin/pm2-docker -> /usr/lib/node_modules/pm2/bin/pm2-docker
/usr/bin/pm2-runtime -> /usr/lib/node_modules/pm2/bin/pm2-runtime
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.7 (node_modules/pm2/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.7: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"arm"})

+ pm2@3.3.1
added 311 packages from 268 contributors in 86.074s
pi@archivesw:~ $ npm install -s -q --unsafe-perm
npm WARN saveError ENOENT: no such file or directory, open '/home/pi/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/home/pi/package.json'
npm WARN pi No description
npm WARN pi No repository field.
npm WARN pi No README data
npm WARN pi No license field.

up to date in 1.092s
found 0 vulnerabilities

pi@archivesw:~ $ sudo n stable

     install : node-v11.10.0
       mkdir : /usr/local/n/versions/node/11.10.0
       fetch : https://nodejs.org/dist/v11.10.0/node-v11.10.0-linux-armv7l.tar.gz
######################################################################## 100.0%
   installed : v11.10.0

pi@archivesw:~ $ pm2 list

                        -------------

__/\\\\\\\\\\\\\____/\\\\____________/\\\\____/\\\\\\\\\_____
 _\/\\\/////////\\\_\/\\\\\\________/\\\\\\__/\\\///////\\\___
  _\/\\\_______\/\\\_\/\\\//\\\____/\\\//\\\_\///______\//\\\__
   _\/\\\\\\\\\\\\\/__\/\\\\///\\\/\\\/_\/\\\___________/\\\/___
    _\/\\\/////////____\/\\\__\///\\\/___\/\\\________/\\\//_____
     _\/\\\_____________\/\\\____\///_____\/\\\_____/\\\//________
      _\/\\\_____________\/\\\_____________\/\\\___/\\\/___________
       _\/\\\_____________\/\\\_____________\/\\\__/\\\\\\\\\\\\\\\_
        _\///______________\///______________\///__\///////////////__


                          Runtime Edition

        PM2 is a Production Process Manager for Node.js applications
                     with a built-in Load Balancer.

                Start and Daemonize any application:
                $ pm2 start app.js

                Load Balance 4 instances of api.js:
                $ pm2 start api.js -i 4

                Monitor in production:
                $ pm2 monitor

                Make pm2 auto-boot at server restart:
                $ pm2 startup

                To go further checkout:
                http://pm2.io/


                        -------------

[PM2] Spawning PM2 daemon with pm2_home=/home/pi/.pm2
[PM2] PM2 Successfully daemonized
β”Œβ”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Name β”‚ id β”‚ mode β”‚ status β”‚ β†Ί β”‚ cpu β”‚ memory β”‚
β””β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”˜
 Use `pm2 show <id|name>` to get more details about an app
pi@archivesw:~ $
1 Like

Now rerun the install script and it should be fine.

OK, great … I just rebooted, will rerun after it’s back up.

Thanks So Much!

1 Like

@GaryFunk

npm - still choking 

Installing required node modules ...
========================================
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.7 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.7: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"arm"})

audited 14811 packages in 31.906s
found 1 moderate severity vulnerability
  run `npm audit fix` to fix them, or `npm audit` for details
Complete ...

if I try and fix I get this …

pi@archivesw:~ $ npm audit fix
npm ERR! code EAUDITNOPJSON
npm ERR! audit No package.json found: Cannot audit a project without a package.json

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/pi/.npm/_logs/2019-02-25T17_22_41_744Z-debug.log
pi@archivesw:~ $
1 Like

NPM warnings may be ignored.

but I can’t connect via web …

and the server shows errored…

pi@archivesw:~/archivesw $ pm2 list
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Name   β”‚ id β”‚ mode   β”‚ status β”‚ β†Ί       β”‚ cpu β”‚ memory β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ Server β”‚ 0  β”‚ 1.7.13 β”‚ fork   β”‚ errored β”‚ 125 β”‚ 0%     β”‚ 0 B    β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”˜
 Use `pm2 show <id|name>` to get more details about an app
pi@archivesw:~/archivesw $
1 Like
pi@archivesw:~/archivesw $ pm2 show 0
 Describing process with id 0 - name Server
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ status            β”‚ errored                           β”‚
β”‚ name              β”‚ Server                            β”‚
β”‚ version           β”‚ 1.7.13                            β”‚
β”‚ restarts          β”‚ 125                               β”‚
β”‚ uptime            β”‚ 0                                 β”‚
β”‚ script path       β”‚ /home/pi/archivesw/server.js      β”‚
β”‚ script args       β”‚ N/A                               β”‚
β”‚ error log path    β”‚ /home/pi/archivesw/log/server.err β”‚
β”‚ out log path      β”‚ /home/pi/.pm2/logs/Server-out.log β”‚
β”‚ pid path          β”‚ /home/pi/.pm2/pids/Server-0.pid   β”‚
β”‚ interpreter       β”‚ node                              β”‚
β”‚ interpreter args  β”‚ N/A                               β”‚
β”‚ script id         β”‚ 0                                 β”‚
β”‚ exec cwd          β”‚ /home/pi/archivesw                β”‚
β”‚ exec mode         β”‚ fork_mode                         β”‚
β”‚ node.js version   β”‚ 11.10.0                           β”‚
β”‚ node env          β”‚ N/A                               β”‚
β”‚ watch & reload    β”‚ ✘                                 β”‚
β”‚ unstable restarts β”‚ 0                                 β”‚
β”‚ created at        β”‚ N/A                               β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
 Add your own code metrics: http://bit.ly/code-metrics
 Use `pm2 logs Server [--lines 1000]` to display logs
 Use `pm2 env 0` to display environement variables
 Use `pm2 monit` to monitor CPU and Memory usage Server
pi@archivesw:~/archivesw $
1 Like

run
pm2 stop Server
node server

Then what is the output from node?

pi@archivesw:~/archivesw $ node server
internal/modules/cjs/loader.js:615
    throw err;
    ^

Error: Cannot find module 'body-parser'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:613:15)
    at Function.Module._load (internal/modules/cjs/loader.js:539:25)
    at Module.require (internal/modules/cjs/loader.js:667:17)
    at require (internal/modules/cjs/helpers.js:20:18)
    at Object.<anonymous> (/home/pi/archivesw/server.js:5:20)
    at Module._compile (internal/modules/cjs/loader.js:738:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:749:10)
    at Module.load (internal/modules/cjs/loader.js:630:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:570:12)
    at Function.Module._load (internal/modules/cjs/loader.js:562:3)
pi@archivesw:~/archivesw $
1 Like

also after starting it shows online - before the error. If I monitor I get this…

Server >     at Object.Module._extensions..js       
 (internal/modules/cjs/loader.js:749:10)            
 Server >     at Module.load (internal/modules/cjs/l
 oader.js:630:32)                                   
 Server >     at tryModuleLoad (internal/modules/cjs
 /loader.js:570:12)                                 
 Server >     at Function.Module._load (internal/mod
 ules/cjs/loader.js:562:3) code: 'MODULE_NOT_FOUND' 
 }                                                  
 PM2 > App [Server:0] exited with code [1] via      
 signal [SIGINT]                                    
 PM2 > Script /home/pi/archivesw/server.js had too  
 many unstable restarts (16). Stopped. "errored"
1 Like

did you run the install.sh script again?

yup, more than 3x now … should I do that again?

1 Like

run

npm install -s

if that does not work then I need to see the contents of package.json

 pi@archivesw:~ $ npm install -s
up to date in 0.68s
found 0 vulnerabilities

pi@archivesw:~ $
1 Like

I have to grab a bite … I’ll reboot and try again in awhile…

thanks for your time…

1 Like

Make sure this is what you are running:

bash -e <(wget -qO - http://fsoft.com/archivesw/script/install.sh)

I had downloaded a copy of the install.sh - saved it in /home/pi –
That’s what I was running… I just ran again from the link you sent. and go this result.

everything clean up to this point…

Installing required node modules ...
========================================
npm WARN checkPermissions Missing write access to /home/pi/archivesw/node_modules/onoff
npm ERR! path /home/pi/archivesw/node_modules/onoff
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall access
npm ERR! Error: EACCES: permission denied, access '/home/pi/archivesw/node_modules/onoff'
npm ERR!  { [Error: EACCES: permission denied, access '/home/pi/archivesw/node_modules/onoff']
npm ERR!   stack:
npm ERR!    "Error: EACCES: permission denied, access '/home/pi/archivesw/node_modules/onoff'",
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'access',
npm ERR!   path: '/home/pi/archivesw/node_modules/onoff' }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator (though this is not recommended).

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/pi/.npm/_logs/2019-02-25T18_21_06_088Z-debug.log
Complete ...
1 Like

okay. ignore that error