Node-Red Palette Manager

I am working with Node-Red Control system with (1) mcp23008 and (2) mcp4725.

The system works fine with Windows through USB.

I am migrating to a Raspberry Pi and have some challenges. The Node-Red Palette Manager identifies and properly installs the mcp23008 Node but fails to identify the mcp4725 Node.

I followed the npm installation instructions and this does not install properly. I can send the log but it would be easier if Node Manager identified the mcp4725 Node and handled the installation.

Hi,

Make sure you’re running the npm install in the node-red directory. On my mac, it is located at ~/.node-red

the . before the directory name indicates a hidden folder so when looking for it make sure to use ls -al to show hidden folders. I will look into adding it as an option through node-red’s palette manager.

Jacob:

I ran from ~/.node-red to get that result. That was in your readme file.

I also ran from there as sudo npm install…

I also ran from ~/.node_red/node_modules with and without sudo. Same result.

Dave

Does it give you any error messages when attempting to do this? I believe running npm as sudo will lead to permissions issues as the files it creates will be owned by the root user and node.js may not be able to access them.

pi@raspberrypi:~/.node-red $ npm install ncd-red-mcp4725
npm WARN checkPermissions Missing write access to /home/pi/.node-red/node_modules/ncd-red-mcp4725
npm ERR! path /home/pi/.node-red/node_modules/ncd-red-mcp4725
npm ERR! code ELOOP
npm ERR! errno -40
npm ERR! syscall access
npm ERR! ELOOP: too many symbolic links encountered, access ‘/home/pi/.node-red/node_modules/ncd-red-mcp4725’

npm ERR! A complete log of this run can be found in:
npm ERR! /home/pi/.npm/_logs/2019-10-10T15_56_53_317Z-debug.log
pi@raspberrypi:~/.node-red $

Yes, it looks like a permissions issue. You might check the log referenced at: /home/pi/.npm/_logs/2019-10-10T15_56_53_317Z-debug.log to see if it mentions any other possible problems.

Can’t you configure all of the ncd node-red nodes to be recognized by the node-red palette manager just like the mcp23008?

I can, I would need to test the library first as I did not write it and haven’t personally tested it.

That would not solve this particular issue though as node-red would be unable to write to the ncd-red-mcp4725 directory to install it.

If you’re using a raspberry pi with the default user running the command line I believe the command you would need is something like sudo chown -R pi:pi ~/.node-red/node_modules/ncd-red-mcp4725

That command will reset the permission to have the pi user own the directory and subsequent files.

Do make sure this is targeting the correct directory as sudo chown commands on the wrong directory can lock your OS permanently.