I am trying to play around with the natural module in Node.JS. I wrote a simple program that takes an input from the browser and uses the Bayes' Classifier to classify it. However, at run time, I get the following error:
/home/hadoop/cloud_major/testing/node_modules/natural/node_modules/apparatus/lib/apparatus/classifier/bayes_classifier.js:95
classifier.__proto__ = BayesClassifier.prototype;
^
TypeError: Cannot set property '__proto__' of undefined
at Function.restore (/home/hadoop/cloud_major/testing/node_modules/natural/node_modules/apparatus/lib/apparatus/classifier/bayes_classifier.js:95:27)
at restore (/home/hadoop/cloud_major/testing/node_modules/natural/lib/natural/classifiers/bayes_classifier.js:37:54)
at /home/hadoop/cloud_major/testing/node_modules/natural/lib/natural/classifiers/bayes_classifier.js:44:23
at /home/hadoop/cloud_major/testing/node_modules/natural/lib/natural/classifiers/classifier.js:114:13
at fs.readFile (fs.js:176:14)
at Object.oncomplete (fs.js:297:15)
Now, for research, I went through the following thread by someone who had a similar problem in another Node.JS module: https://github.com/andris9/mailcomposer/issues/6 I followed the solution of uninstalling and reinstalling natural, with no help. I also found: http://tommytcchan.blogspot.in/2012_07_01_archive.html I used npm ls to get:
├─┬ natural@0.1.17
│ ├─┬ apparatus@0.0.6
│ │ └── sylvester@0.0.21
│ └── underscore@1.4.2
Then, I went through: Find the version of an installed npm package and got the following output:
├─┬ natural@0.1.17
│ ├─┬ apparatus@0.0.6
│ │ └── sylvester@0.0.21
│ └── underscore@1.4.2
i.e. I think that local version of the installed packages matches the dependencies required.Has anyone else used this package, and managed to debug this error?
Many thanks in advance!