WiringPi / WiringPi-Node

Node.js bindings to wiringPi
333 stars 94 forks source link

Build failure: install.sh: line 28: ../../install.log: Permission denied #86

Open michaeljanich opened 6 years ago

michaeljanich commented 6 years ago

$ sudo npm i -g wiringpi-node

wiringpi-node@2.4.4 install /usr/local/lib/node_modules/wiringpi-node /bin/bash ./install.sh

Making libWiringPi ... ./install.sh: line 28: ../../install.log: Permission denied ./install.sh: line 29: ../../install.log: Permission denied failed.

Cannot find file install.sh to fix it. All directories removed again. If I press CTRL-C during the build, I still cannot find the file.

THANKS!!

-M
bgiddings commented 6 years ago

Node tries to install as user nobody:

https://github.com/npm/npm/issues/1259

Which is seen as a security issue by many:

https://github.com/npm/npm/issues/3849

There's apparently a work-around of using the "unsafe" flag:

sudo npm install blerg --unsafe

What's happening here is that it is trying to create the file install.log in the current directory:

git clone https://github.com/nekuz0r/wiringpi.git -b 2.25 > ./install.log 2>&1

But, since "nobody" has no access, it fails.

If it used something like mktemp it could possibly still run as nobody, but it seems like installed files should be owned by a non-nobody user.