Rpanion-server icon indicating copy to clipboard operation
Rpanion-server copied to clipboard

Bug fix: Install first the npm package

Open hilarioaraujo opened this issue 1 year ago • 6 comments

I was trying to install the Rpanion and I received a bug message in the npm installation. Then i discovered and fix. First it's needed to install the npm package with "apt install npm" then we have to install the react-scripts with the "npm install"

hilarioaraujo avatar Aug 08 '23 15:08 hilarioaraujo

npm is installed here: https://github.com/stephendade/Rpanion-server/blob/master/deploy/RasPi2-3-4-deploy.sh#L34, as part of the nodejs package.

stephendade avatar Aug 09 '23 22:08 stephendade

@hilarioaraujo what was the bug? what hardware are you using? what OS?

tmarkson avatar Aug 11 '23 23:08 tmarkson

I am sorry for the late sir.

hilarioaraujo avatar Aug 22 '23 10:08 hilarioaraujo

When I was trying install the Rpanion in Raspberry 4 with ubuntu 22.04 OS appear a error in the npm installation.

I opened the bash file of installation and appear that the npm method install is wrong, and i change it.

I change this: npm install NPM_INSTALL_EXIT_CODE=$?

to this: sudo apt install -y npm npm install NPM_INSTALL_EXIT_CODE=$?

In this way, I was succeed in the installation.

hilarioaraujo avatar Aug 22 '23 11:08 hilarioaraujo

It's possible npm failed to install on the system during the nodejs install process; I've seen failures on boards other than Raspi that weren't handled. But as @stephendade suggested, npm should be installed for the target user normally. If you install Rpanion again, I'd suggest checking the output of the log script to watch for failure around nodejs.

tmarkson avatar Aug 22 '23 19:08 tmarkson

@tmarkson Is it possible for the script to do more, such as: a) detect if the binary or package has been installed, if installed then skip; b) check if the bash execute successfully, if failed then stop and wait for further instruction; c) as there might be some internet connect issues, then add loop trys ( I have seen the code in script, but it seems not work the way it designed to do so. well, maybe I'm wrong about that.)

lida2003 avatar Jan 20 '24 23:01 lida2003