1
votes

For having natural language processing facility. Have added natural node package in my application using "npm install natural". But after installation while running the application using "sudo meteor", got some error about ""ReferenceError: require is not defined"". After googling found that need to do following steps:

1) Remove node_modules on the top of the root of the application (Done this part)

2) Added "natural": "0.1.27" in packages.json file also

3) Install npm using ""mrt add npm"". But getting following error after installing it in the application, while using ""sudo meteor"".

        => Meteor 0.8.1.3 is available. Update this project with 'meteor update'.

Initializing mongo database... this may take a moment. npm ERR! missing: [email protected], required by [email protected] npm ERR! missing: [email protected], required by [email protected] npm ERR! not ok code 0

=> Errors prevented startup:

While building package router: error: no such package: 'ui'

While building package npm: error: couldn't read npm version lock information

=> Your application has errors. Waiting for file change.

Any pointers what should be done. Not getting anything, this error taking my whole time. Thanks in advance

1
Have you tried running meteor update? - boulaycote
Yup, have done meteor update. Also tried to change version of it to 0.8.0, now getting stuck in syntacticalpart of "A template tag of type TRIPLE is not allowed here.". Any pointers what could be done - priya
This is not the same issue. Can you show some code? TRIPLE are theses right? {{{template}}} - boulaycote
Html file having triple tag is : <input id='check' class="check" name="markdone" type="checkbox" {{{ done}}} />Get Notifications Corresponding .js file is:Template.subscribedKeyword.done = function () { }; . How to prevent this error from coming?. Also I upgraded the version to prevent that npm error. Are these not related to each other? - priya
Simply use 2 braces. {{done}} - boulaycote

1 Answers

1
votes

To use NPM packages within your meteor application you need to first install meteor-npm mrt add npm

You then have to add a packages.json file at the root of your project like so;

{
  "natural": "0.1.27"
}

When this file changes, meteor will automatically update its dependencies.

You can then use var natural = Meteor.require("natural")