OrangePi 5B - player2 installation issues with npm

Comments

14 comments

  • Avatar
    Abhijith B N

    Can you check if the same issue occurs with Node 16?
     

    1. Uninstall Node14 by issuing sudo apt-get purge nodejs . This should uninstall both node and npm.
    2. Check if npm and node still return any versions by issuing node -v and npm -v . Both commands should result in "command not found"
    3. Setup source list for Node16 by issuing curl -sL https://deb.nodesource.com/setup_16.x | sudo bash -
    4. Install node using sudo apt-get install -y nodejs

     
    Then update npm to the latest version using the command  sudo npm i update npm -g

    0
    Comment actions Permalink
  • Avatar
    Mathieu Gosset

    npm seems to work now but gives different errors:

    pi@orangepi5b:~$ sudo npm i update npm -g
    npm ERR! code EBADENGINE
    npm ERR! engine Unsupported engine
    npm ERR! engine Not compatible with your version of node/npm: npm@10.1.0
    npm ERR! notsup Not compatible with your version of node/npm: npm@10.1.0
    npm ERR! notsup Required: {"node":"^18.17.0 || >=20.5.0"}
    npm ERR! notsup Actual:   {"npm":"8.19.4","node":"v16.20.2"}

    npm ERR! A complete log of this run can be found in:
    npm ERR!     /root/.npm/_logs/2023-09-13T16_24_29_952Z-debug-0.log

     

    log file:

    0 verbose cli /usr/bin/node /usr/bin/npm
    1 info using npm@8.19.4
    2 info using node@v16.20.2
    3 timing npm:load:whichnode Completed in 0ms
    4 timing config:load:defaults Completed in 2ms
    5 timing config:load:file:/usr/lib/node_modules/npm/npmrc Completed in 2ms
    6 timing config:load:builtin Completed in 3ms
    7 timing config:load:cli Completed in 3ms
    8 timing config:load:env Completed in 0ms
    9 timing config:load:project Completed in 2ms
    10 timing config:load:file:/root/.npmrc Completed in 0ms
    11 timing config:load:user Completed in 0ms
    12 timing config:load:file:/usr/etc/npmrc Completed in 1ms
    13 timing config:load:global Completed in 1ms
    14 timing config:load:validate Completed in 0ms
    15 timing config:load:credentials Completed in 1ms
    16 timing config:load:setEnvs Completed in 1ms
    17 timing config:load Completed in 13ms
    18 timing npm:load:configload Completed in 13ms
    19 timing npm:load:mkdirpcache Completed in 5ms
    20 timing npm:load:mkdirplogs Completed in 1ms
    21 verbose title npm i update npm
    22 verbose argv "i" "update" "npm" "--global"
    23 timing npm:load:setTitle Completed in 2ms
    24 timing config:load:flatten Completed in 3ms
    25 timing npm:load:display Completed in 5ms
    26 verbose logfile logs-max:10 dir:/root/.npm/_logs
    27 verbose logfile /root/.npm/_logs/2023-09-13T16_24_29_952Z-debug-0.log
    28 timing npm:load:logFile Completed in 6ms
    29 timing npm:load:timers Completed in 0ms
    30 timing npm:load:configScope Completed in 0ms
    31 timing npm:load Completed in 32ms
    32 silly logfile done cleaning log files
    33 http fetch GET 200 https://registry.npmjs.org/npm 278ms (cache revalidated)
    34 timing command:i Completed in 341ms
    35 verbose stack Error: Unsupported engine
    35 verbose stack     at Object.checkEngine (/usr/lib/node_modules/npm/node_modules/npm-install-checks/lib/index.js:14:25)
    35 verbose stack     at Install.exec (/usr/lib/node_modules/npm/lib/commands/install.js:109:16)
    35 verbose stack     at async module.exports (/usr/lib/node_modules/npm/lib/cli.js:78:5)
    36 verbose pkgid npm@10.1.0
    37 verbose cwd /home/pi
    38 verbose Linux 5.10.110-rockchip-rk3588
    39 verbose node v16.20.2
    40 verbose npm  v8.19.4
    41 error code EBADENGINE
    42 error engine Unsupported engine
    43 error engine Not compatible with your version of node/npm: npm@10.1.0
    44 error notsup Not compatible with your version of node/npm: npm@10.1.0
    44 error notsup Required: {"node":"^18.17.0 || >=20.5.0"}
    44 error notsup Actual:   {"npm":"8.19.4","node":"v16.20.2"}
    45 verbose exit 1
    46 timing npm Completed in 452ms
    47 verbose code 1
    48 error A complete log of this run can be found in:
    48 error     /root/.npm/_logs/2023-09-13T16_24_29_952Z-debug-0.log
    0
    Comment actions Permalink
  • Avatar
    Mathieu Gosset

    Even when I installed node v18.17.1 with npm 10.1.0

    The start.sh script outputs:

    pi@orangepi5b:~$ sh start.sh
    node:internal/errors:496
        ErrorCaptureStackTrace(err);
        ^

    Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'pm2' imported from /home/pi/player2/monitor.mjs
        at new NodeError (node:internal/errors:405:5)
        at packageResolve (node:internal/modules/esm/resolve:887:9)
        at moduleResolve (node:internal/modules/esm/resolve:936:20)
        at defaultResolve (node:internal/modules/esm/resolve:1129:11)
        at nextResolve (node:internal/modules/esm/loader:163:28)
        at ESMLoader.resolve (node:internal/modules/esm/loader:835:30)
        at ESMLoader.getModuleJob (node:internal/modules/esm/loader:424:18)
        at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:77:40)
        at link (node:internal/modules/esm/module_job:76:36) {
      code: 'ERR_MODULE_NOT_FOUND'
    }

    When trying to install the pm2 package 

    pi@orangepi5b:~$ sudo npm install pm2 -g
    npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.

    added 157 packages in 5s

    12 packages are looking for funding
      run `npm fund` for details
    pi@orangepi5b:~$ npm list
    /home/pi
    └── (empty)
    pi@orangepi5b:~$ npm install
    npm ERR! code ENOENT
    npm ERR! syscall open
    npm ERR! path /home/pi/package.json
    npm ERR! errno -2
    npm ERR! enoent ENOENT: no such file or directory, open '/home/pi/package.json'
    npm ERR! enoent This is related to npm not being able to find a file.
    npm ERR! enoent

    npm ERR! A complete log of this run can be found in: /home/pi/.npm/_logs/2023-09-14T09_41_53_742Z-debug-0.log

     

     

    0
    Comment actions Permalink
  • Avatar
    Mathieu Gosset

    Anyway pm2 is installed in global

    pi@orangepi5b:~$ npm list
    /home/pi
    └── (empty)

    pi@orangepi5b:~$ npm list -g
    /usr/lib
    ├── corepack@0.18.0
    ├── npm@10.1.0
    ├── pm2@5.3.0
    └── update@0.7.4

     

    The start.sh script might be using the wrong npm directory?

    0
    Comment actions Permalink
  • Avatar
    Abhijith B N

    Hey Mathieu

    Thank you for your patience.

    Looks like you got the expected output when you installed pm2.

    pi@orangepi5b:~$ sudo npm install pm2 -g
    npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.

    added 157 packages in 5s

    12 packages are looking for funding
    run `npm fund` for details

     

    When you run the npm install command you have to be in the /home/pi/player2 directory.

    The error you see 

    ENOENT: no such file or directory, open '/home/pi/package.json

    Indicates that npm is not able to file the package.json file which is in the /home/pi/player2 directory.

    You have to issue the following 2 commands

    cd /home/pi/player2
    npm install


    Once that's done, start.sh script should work since pm2 is installed.

     

    0
    Comment actions Permalink
  • Avatar
    Mathieu Gosset

    Hi Abhijith,

    Thank you for your help!

    Now I run the start.sh script and after a while it says "piSignage is running fine"
    But how do I get the player running at system boot and showing the signage screen without taskbar and chromium tab bar etc, just clean view?

    0
    Comment actions Permalink
  • Avatar
    Mathieu Gosset

    Hi Abhijith,

    Any update on the issue? 🙈

    Kind regards,
    Mathieu

    0
    Comment actions Permalink
  • Avatar
    Abhijith B N

    Hey Mathieu Gosset

    Apologies for the late response.

    The script to disable the Window Title Bars, and to enable piSignage on boot differs from one system to another system

    We would need the WindowManager, DisplayManager, DesktopEnvironment to help you with this.

    Can you please create a file, example environmentShell.sh and run the script by connecting a keyboard to your Orange pi as the output differs when you use SSH?

    WINDOW_MANAGER=$(DISPLAY=:0.0 wmctrl -m | awk '/Name:/ {print $2}')

    echo "Window Manager is $WINDOW_MANAGER" # currently supported is GNOME Shell,Mutter, Openbox,KWin

    DISPLAY_MANAGER=$(basename $(cat /etc/X11/default-display-manager) ) # currently supported is lightdm,gdm3,sddm

    echo "Display Manager is $DISPLAY_MANAGER"

    echo "Windowing System is $XDG_SESSION_TYPE" #does not work from ssh #x11

    echo "Desktop Environment is $XDG_CURRENT_DESKTOP" #does not work from ssh #LXDE,Ubuntu GNOME,GNOME

     

    You can also install the dconf-editor to modify system settings to hide your window title bars.

    sudo apt-get -y install wmctrl dconf-editor
     
    0
    Comment actions Permalink
  • Avatar
    Mathieu Gosset

    Hi Abhijith B N

    I got following response from the pi (not using SSH):

    Window Manager is Xfwm4
    Display Manager is lightdm
    Windowing System is x11
    Desktop Environment is XFCE

    So I guess we need to change the Window Manager?

    0
    Comment actions Permalink
  • Avatar
    Abhijith B N

    You might have to do the following modifications

    1) Enable Autologin without the need to enter a password

    2) AutoStart piSignage service on boot

    3) Hide Top/Side/Bottom panels and window title bars.

    4) Disable Screensaver and screen lock

     

    You can make most of these changes using dconf-editor

    Reference: https://wiki.gnome.org/Apps/DconfEditor

     

    0
    Comment actions Permalink
  • Avatar
    Mathieu Gosset

    Yes I did that.

    What exactly should be happening after startup?
    Can you explain the process?

    Now it just starts up and I see a desktop background...

    0
    Comment actions Permalink
  • Avatar
    Abhijith B N

    Once your player starts, after the Desktop loads, the pm2 piSignage service should start and you should see a 16-Digit Player ID in your Chromium Browser.

    You could also post the /home/pi/forever_out.log for us to check if there are any errors.

    0
    Comment actions Permalink
  • Avatar
    Fisherrs

    I think when I had similar issues (intel nuc, Debian 11) I had to install python3-pip and the chromium-browser install/link

    • sudo apt-get -y install chromium
    • cd /usr/bin
    • sudo ln -s chromium chromium-browser

    Then reran the install.

    1
    Comment actions Permalink
  • Avatar
    Mathieu Gosset

    Fisherrs
    Wow great thank, that did the job!!

    sudo apt install python3-pip
    1
    Comment actions Permalink

Please sign in to leave a comment.

Powered by Zendesk