Rpanion-server
Rpanion-server copied to clipboard
Bug fix: Install first the npm package
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"
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.
@hilarioaraujo what was the bug? what hardware are you using? what OS?
I am sorry for the late sir.
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.
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 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.)