freedomjs / freedom-port-control

Opens ports through a NAT with NAT-PMP, PCP, and UPnP
11 stars 3 forks source link

require the module #6

Closed louptheron closed 8 years ago

louptheron commented 8 years ago

Hi,

stupid question... but how do I require this module ?

I npm install --save and npm install --dev

Error: Cannot find module 'freedom-port-control'

Thank you

willscott commented 8 years ago

This module doesn't define a main entry-point. after npm install freedom-port-control

you'll need to specify the actual entry point

var portcontrol = require('freedom-port-control/src/port-control');

this probably still won't work, since this code is meant to be run by freedom. to make that work, you'll need to install freedom-for-node and then

var freedom = require('freedom-for-node');
var portcontrol = freedom('node_modules/freedom-port-control/src/port-control.json');
louptheron commented 8 years ago

Thank you for the help.

There are some errors with dependencies (bufferutil and utf-8-validate) when npm install freedom-for-node, so not related to freedom. https://github.com/websockets/bufferutil/issues/22