Jump to content

Node Error "Cannot find module 'tinkerforge'"


Recommended Posts

Posted

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.

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...