rwblinn Geschrieben July 16, 2016 at 10:19 Geschrieben July 16, 2016 at 10:19 Hi, tried to run on a Raspberry Pi with Master Brick, Wifi Ext 2.0, Ambientlight the ExampleSimple.js. When running from the commandline $node ExampleSimple.js, received error: module.js:340 throw err; ^ Error: Cannot find module 'tinkerforge' The line in ExampleSimple.js not changed: var Tinkerforge = require('tinkerforge'); Installed the javaScript bindings using npm. Steps taken as user Pi with install message. cd /home/pi sudo npm -g install tinkerforge tinkerforge@2.0.9 /usr/lib/node_modules/tinkerforge When adding the full path to require('/usr/lib/node_modules/tinkerforge') it is working. How to setup without the need to add the full path in require. Any help appreciated. Zitieren
Nic Geschrieben July 19, 2016 at 08:53 Geschrieben July 19, 2016 at 08:53 I had the same behaviour. After I installed the Tinkerforge modules globally, it was finally located in e.g. /usr/lib/node_modules. But its needed to add this location in NODE_PATH var to env in Linux like # export NODE_PATH=$NODE_PATH:/usr/lib/node_modules # env ... NODE_PATH=:/usr/lib/node_modules ... Ref.: http://www.tinkerunity.org/forum/index.php/topic,2216.msg14527.html#msg14527 Zitieren
rwblinn Geschrieben July 19, 2016 at 20:08 Autor Geschrieben July 19, 2016 at 20:08 Great hint - Many Thanks. Zitieren
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.