monteslu / node-red-contrib-gpio

A set of node-red nodes for connecting to johnny-five IO Plugins
MIT License
41 stars 31 forks source link

RASPBERRY PI- sudo npm install node-red-contrib-gpio -g #8

Open rprasanth opened 8 years ago

rprasanth commented 8 years ago

when i try to install in my raspberry pi its is throwing these errors, how could i resolve this issue, reply me plz sudo npm install node-red-contrib-gpio -g npm WARN locking Error: EEXIST, open '/root/.npm/_locks/node-red-contrib-gpio-05c620f26fa23ec7.lock' npm WARN locking at Error (native) npm WARN locking /root/.npm/_locks/node-red-contrib-gpio-05c620f26fa23ec7.lock failed { [Error: EEXIST, open '/root/.npm/_locks/node-red-contrib-gpio-05c620f26fa23ec7.lock'] npm WARN locking errno: -17, npm WARN locking code: 'EEXIST', npm WARN locking path: '/root/.npm/_locks/node-red-contrib-gpio-05c620f26fa23ec7.lock' } npm ERR! Linux 4.1.17-v7+ npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install" "node-red-contrib-gpio" "-g" npm ERR! node v0.12.10 npm ERR! npm v2.14.9

npm ERR! Attempt to unlock /usr/lib/node_modules/node-red-contrib-gpio, which hasn't been locked npm ERR! npm ERR! If you need help, you may report this error at: npm ERR! https://github.com/npm/npm/issues

npm ERR! Please include the following file with any support request: npm ERR! /home/pi/npm-debug.log

monteslu commented 8 years ago

you shouldn't need to install this with sudo Can you try just going into your ~/.node-red folder and doing a normal npm i node-red-contrib-gpio

monteslu commented 8 years ago

@rprasanth you might also want to take a look here: https://github.com/rwaldron/johnny-five/wiki/Getting-started-with-Raspberry-Pi-node-red-and-IoT

rprasanth commented 8 years ago

its getting build in the home directory under node_modules, but the nodes are not visible in browser, please help to find the issue to solve!!! does i have to change the path of the node, if it is so, how can i do that?? i did the same procedure in the desktop Ubuntu, it got installed and its showing every nodes, but in pi i am not getting, please help

screenshot from 2016-02-18 12-22-15

gotititu commented 8 years ago

@rprasanth You might have solved the issue by now.

After numerous attempts on my Rpi 3, I finally got the right recipe. The below is for raspbain version code name jessie march 2016 release kernel 4.1

Step 1) Uninstall everything as mentioned in manual section http://nodered.org/docs/hardware/raspberrypi. I went ahead and removed ~/.node-red directory from root and made sure npm remove all the nodes from /usr/lib/node_modules. If not then you will have to use --force to clear cache while installing it again.

Step 2) Follow the same guide and install nodejs 4.4.2 and npm

Step 3) Now the tricky part, in documentation it is mentioned to install extra nodes such as node-red-contrib-gpio in ~/.node-red, but that didn't work for me, so I went ahead and installed under root (use force if your /usr/lib/node_modules is not empty) sudo npm install -g johny-five --unsafe-perm --force sudo npm install -g raspi-io --unsafe-perm --force sudo npm install -g node-red-contrib-gpio --unsafe-perm --force

everything should work fine, it did work for me.

TTVert commented 7 years ago

Hate to bring this back up but has anyone found a better solution to this? The only way I can get raspi-io to run is if I run node-red as admin and I'd rather not have to do this. If I run node-red as a regular user I will get app bootloops w/ the error below. I'm on Raspian Jessie kernel 4.4.38-v7+

pi Node-RED[23314]: wiringPiSetup: Must be root. (Did you forget sudo?) pi systemd[1]: nodered.service: main process exited, code=killed, status=6/ABRT