gmosx / inflection

A port of the Rails/ActiveSupport inflector to JavaScript
http://www.nitrojs.org
55 stars 13 forks source link

Doesn't seem to work at all with modern Node (0.8.8) #3

Open tlhunter opened 11 years ago

tlhunter commented 11 years ago

Code:

var singularize = require("inflection").singularize;
console.log(singularize('bananas'));

Output:

/blah/node_modules/inflection/lib/inflection.js:271
      return this._apply_rules( str, singular_rules, uncountable_words, singul
                  ^
TypeError: Object #<Object> has no method '_apply_rules'
    at inflector.singularize (/blah/node_modules/inflection/lib/inflection.js:271:19)
    at Object.<anonymous> (/blah/node_modules/easyxml/index.js:2:13)
    at Module._compile (module.js:449:26)
    at Object.Module._extensions..js (module.js:467:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:362:17)
    at require (module.js:378:17)
    at Object.<anonymous> (/blah/server.js:1:77)
    at Module._compile (module.js:449:26)
dmiro commented 11 years ago

tlhunter , I think you're confused. I have the same error, but I've noticed that when you install the module with "npm install inflection". You are installing the repository https://github.com/dreamerslab/node.inflection

ben-lin commented 11 years ago

please try to install the latest version v1.2.6