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.
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.
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.
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.
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.