moos / wordpos

Part-of-speech utilities for node.js based on the WordNet database.
477 stars 41 forks source link

ReferenceError: Promise is not defined #14

Closed irSteve closed 7 years ago

irSteve commented 8 years ago

On an Ubuntu VM running on Azure, I am getting this error:

ReferenceError: Promise is not defined at null.getNouns (/home/azureuser/node/XMLParser/node_modules/wordpos/src/wordpos.js:131:12)

When I debug with the node debugger, I can see that wordPOS and getNouns() are clearly there when instantiating like this:

var WordPOS = require('wordpos'); var wordpos = new WordPOS();

I have tried this code form:

`wordpos.getNouns(_content, function(result, err){ if(err){ console.log(err.message); return; }

  _item.tags = result;
});`

and this code form: wordpos.getNouns(_content) .then(function(result){ _item.tags = result; }) .catch(function(err){ console.log('Error in backdoorsurvival: ' + err.message); });

with identical results.

This seems like its broken but I could be missing some key info - in which case I would appreciate your feedback.

moos commented 8 years ago

Verify your version of nodejs -- try this:

$ node -v
v5.4.0

$ node
> typeof Promise
'function'
>
(To exit, press ^C again or type .exit)
>
moos commented 7 years ago

Inactive - closing.