OrangePi 5B - player2 installation issues with npm
I am having a lot of issues installing PiSignage on OrangePi 5B.
Started here:
https://github.com/colloqi/piSignage/issues/222
Now we're here:
Node
v14.21.3
NPM
6.14.18
Did a reboot and started up to desktop, tried
sh start.sh
Gave the pm2 error again and tried
sudo npm install pm2 -g
Which leads to following new error:
TypeError: isexe is not a function
https://ibb.co/YkwPQKL
-
Can you check if the same issue occurs with Node 16?
- Uninstall Node14 by issuing
sudo apt-get purge nodejs
. This should uninstall both node and npm. - Check if npm and node still return any versions by issuing
node -v
andnpm -v
. Both commands should result in "command not found" - Setup source list for Node16 by issuing
curl -sL https://deb.nodesource.com/setup_16.x | sudo bash -
- Install node using
sudo apt-get install -y nodejs
Then update npm to the latest version using the commandsudo npm i update npm -g
- Uninstall Node14 by issuing
-
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.loglog 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 -
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 -
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 detailsWhen 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. -
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,GNOMEYou can also install the dconf-editor to modify system settings to hide your window title bars.
sudo apt-get -y install wmctrl dconf-editor
-
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 XFCESo I guess we need to change the Window Manager?
-
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
-
Fisherrs
Wow great thank, that did the job!!sudo apt install python3-pip
Please sign in to leave a comment.
Comments
14 comments