Node-red-contrib-rfxcom

#1

I'm trying to install node-red-contrib-rfxcom nodes on my pi but i'm getting an error i cant understand

installing from node-red admin fails.

This is the result when installing trough terminal

svefro-pi-home:/home/pi# npm install -g node-red-contrib-rfxcom
(node:3767) [DEP0022] DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead.
npm ERR! Error: Method Not Allowed
npm ERR!     at errorResponse (/usr/share/npm/lib/cache/add-named.js:260:10)
npm ERR!     at /usr/share/npm/lib/cache/add-named.js:203:12
npm ERR!     at saved (/usr/share/npm/node_modules/npm-registry-client/lib/get.js:167:7)
npm ERR!     at FSReqWrap.oncomplete (fs.js:135:15)
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR!     <http://github.com/npm/npm/issues>

npm ERR! System Linux 4.14.71-v7+
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install" "-g" "node-red-contrib-rfxcom"
npm ERR! cwd /home/pi
npm ERR! node -v v8.11.1
npm ERR! npm -v 1.4.21
npm ERR! code E405
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     /home/pi/npm-debug.log
npm ERR! not ok code 0

Anybody have a clue?

#2

As a matter of interest, why are you installing it globally? Normally nodes should be installed locally, from within the .node-red directory. However I don't think that would cause the problem.

Did you install using the recommended script from https://nodered.org/docs/hardware/raspberrypi?
If so that should have installed compatible versions of node.js and npm. So if you haven't installed like that then I suggest you try that first.
Otherwise what versions of node and npm are you running

npm -v
node -v

[Edit]
Just noticed the versions in your previous post. npm 1.4.21 is ancient and it is highly likely that is the problem. Run the upgrade script I linked to.

1 Like
#3

If you do get a problem with serial ports when installing locally, it will be because the user ID running Node-RED doesn't have the correct permissions. If I remember correctly, it needs to be in group "Wheel".

#4

i ran the upgrade script and now everything work fine :smile:

I did not install using the upgrade script since i had some issues with it a while ago.
Thank you very much for the help.

#5

npm was back at 1.4.2. It should have been upgraded. The upgrade script has fixed that.

#6

If you still have nodes installed globally, this is very likely to come back and bite you in the future. It is hard to say how many times so many of us have said not to do this. The documentation makes this clear as well.