Node-red-contrib-canbus install failed

#1

Hello,

I am trying to re install the node-red-contrib-canbus which was working fine previoulsy, they made some changes on the Git source and since then it seems I am not able to install that node. I belive the node red package needs to be updated to match the new version requirements but I am not sure how to do this.

imake: *** [Release/obj.target/can_signals/src/signals.o] Erreur 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack     at ChildProcess.emit (events.js:182:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:240:12)
gyp ERR! System Linux 4.14.79-v7+
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/pi/.node-red/node_modules/node-red-contrib-canbus/node_modules/socketcan
gyp ERR! node -v v10.15.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm WARN node-red-project@0.0.1 No repository field.
npm WARN node-red-project@0.0.1 No license field.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! socketcan@2.1.3 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the socketcan@2.1.3 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR!     /home/pi/.npm/_logs/2019-01-23T06_48_02_657Z-debug.log

On the end of the npm package i get thoses warning after installing npm socketcan

/home/pi/.node-gyp/10.15.0/include/node/v8.h:10046:15: note: declared here

Local<Object> Value::ToObject() const {

^~~~~

SOLINK_MODULE(target) Release/obj.target/can_signals.node

COPY Release/can_signals.node

make : on quitte le répertoire « /home/pi/node_modules/socketcan/build »

npm WARN saveError ENOENT: no such file or directory, open '/home/pi/package.json'

npm WARN enoent ENOENT: no such file or directory, open '/home/pi/package.json'

npm WARN pi No description

npm WARN pi No repository field.

npm WARN pi No README data

npm WARN pi No license field.

+ [socketcan@2.4.0](mailto:socketcan@2.4.0)

updated 1 package and audited 11 packages in 19.04s

found 0 vulnerabilities
0 Likes

#2

What command are you using to install it and from which directory? The log seems to suggest you are running it from /home/pi instead of /home/pi/.node-red.

0 Likes

#3

Well, for the first one i am basically installing it from the palette from inside node.red so i would be surprise not to point on the right location. For the second, i run this npm install from the root itself as this is not purely related to node.red. Installing in the .node-red directory the socketcan module doesn't work either...

0 Likes

#4

Generally, if you feel you are being forced to do a global install to get a node working, there is something else wrong since there should be no reason for this.

The most common issue is a user permissions issue. Quite possibly, the user being used to run Node-RED doesn't have the right permissions so you need to trace back to what needs to be accessed, find out what permissions it requires and then update your user accordingly.

For example, accessing some hardware on a Linux server often requires the user to be a member of a group such as wheel.

This is a common BlueTooth installation issue.

You will need to raise an issue with the node's author.

In the meantime, you can always install a specific version of a node from the command line something like the following:

# Go to the right place - the userDir folder, usually in this location:
cd ~/.node-red
# Install the specific version required:
npm install node-red-contrib-canbus@<version-required>

You may need to look up the required version from the npmjs web site or GitHub.

1 Like