Cloud-Automation / node-modbus

Modbus TCP Client/Server implementation for Node.JS
471 stars 175 forks source link

modbus-tool doesnt work with nvm #3

Closed animedbz16 closed 9 years ago

animedbz16 commented 9 years ago

I know this isn't the right project, but it appears the modbus-tool project is no longer available or maybe private now?

Either way I installed modbus-tool via NPM (https://www.npmjs.com/package/modbus-tool) while running node via nvm and attempted to run the executable, but received the following error:

[user@server ~]$ modbus-tool --help
bash: /path/to/home/dir/.nvm/v0.10.35/bin/modbus-tool: /usr/local/bin/node: bad interpreter: No such file or directory

This is due to the fact that node is not installed in /usr/local/bin/node, while the script appears to be hard-coded as such.

Changing the first line of the script to following corrects this, since it will use the appropriately loaded node from the environment

[user@server ~]$ head -n 1 /path/to/home/dir/.nvm/v0.10.35/lib/node_modules/modbus-tool/bin/modbus-tool
#! /usr/bin/env node
Cloud-Automation commented 9 years ago

Thanks for your input, but, as you mentioned this is not the modbus-tools repository. The Modbus Tools are no longer maintained, sorry.