I think the problem is inner is not in the scope where you call it. If you change the above exaple to module.exports.inner('value') it should work.
Normally, you would use a class pattern and call this.inner, or define the inner function outside module.exports, so that it is in scope of the function inside.