pilo icon indicating copy to clipboard operation
pilo copied to clipboard

Installing the npm pilo package failes

Open johnjore opened this issue 5 years ago • 2 comments

Hi and I'm trying to do the same. However, there is something not right with the command to install the project itself and this is on a new install using "2020-05-27-raspios-buster-lite-armhf.img". I've added u4l using these two commands:

curl http://www.linux-projects.org/listing/uv4l_repo/lpkey.asc | sudo apt-key add -
echo 'deb http://www.linux-projects.org/listing/uv4l_repo/raspbian/stretch stretch main' | sudo tee -a /etc/apt/sources.list

But this step fails (running as root)

npm install --global pilo --unsafe-perms
npm WARN npm npm does not support Node.js v10.21.0
npm WARN npm You should probably upgrade to a newer version of node as we
npm WARN npm can't make any promises that npm will work with this version.
npm WARN npm Supported releases of Node.js are the latest release of 4, 6, 7, 8, 9.
npm WARN npm You can find the latest version at https://nodejs.org/
/usr/local/bin/pilo -> /usr/local/lib/node_modules/pilo/server/dist/index.js

> @serialport/[email protected] install /usr/local/lib/node_modules/pilo/node_modules/@serialport/bindings
> prebuild-install --tag-prefix @serialport/bindings@ || node-gyp rebuild

prebuild-install WARN install EACCES: permission denied, access '/root/.npm'
gyp ERR! configure error
gyp ERR! stack Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/pilo/node_modules/@serialport/bindings/build'
gyp ERR! System Linux 5.4.51-v7+
gyp ERR! command "/usr/bin/node" "/usr/bin/node-gyp" "rebuild"
gyp ERR! cwd /usr/local/lib/node_modules/pilo/node_modules/@serialport/bindings
gyp ERR! node -v v10.21.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @serialport/[email protected] install: `prebuild-install --tag-prefix @serialport/bindings@ || node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @serialport/[email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2020-10-05T06_42_01_247Z-debug.log

Using the 'pi' account also fails, with and without sudo.

Any ideas?

johnjore avatar Oct 05 '20 06:10 johnjore

Looks like a simple fix, just update the command that creates the folder with "-p": mkdir /usr/local/lib/node_modules/pilo/node_modules/@serialport/bindings/build -p

johnjore avatar Oct 05 '20 07:10 johnjore

This seems to be an issue with the Guide. The correct parameter for npm is --unsafe-perm, without the "s".

nemhods avatar Nov 14 '21 10:11 nemhods