Sasikanth
Sasikanth

Reputation: 3043

how to use nodejs packages in meteor

how to use nodejs package in meteor app.

i tried to install module in app directory it is showing error

npm install skimlinksjs

npm WARN package.json [email protected] No description
npm WARN package.json [email protected] No repository field.
npm http GET https://registry.npmjs.org/skimlinksjs
npm http 304 https://registry.npmjs.org/skimlinksjs
npm WARN engine [email protected]: wanted: {"node":"~0.6.15"} (current: {"node":"v0.10.24","npm":"1.3.21"})
[email protected] ../../node_modules/skimlinksjs

What is this error and how to use it in the app?

Upvotes: 0

Views: 341

Answers (1)

Hubert OG
Hubert OG

Reputation: 19544

Don't do that, and remove the node_modules directory. Most node modules will not work like that due to Meteor's file wrapping and ordering. They just won't load properly.

To use a node module:

  • Grab npm package via mrt add npm command.
  • Add packages.json file with the list of necessary packages, for example:

 

{
  "candle": "0.4.0",
  "oauth":  "0.9.11"
}

 

  • Afterwards, you can require the package with Meteor.require('packagename');.

Upvotes: 2

Related Questions