First time trying to use node module with meteor
installed:
meteor add meteorhacks:npm
then installed:
npm install multer
have a separate file in the server directory, called "loadMulter" with just this one line:
var multer = Meteor.npmRequire('multer');
now, running "meteor" and getting this error:
W20150609-12:22:56.528(-5)? (STDERR)
W20150609-12:22:56.528(-5)? (STDERR) /home/eugene/.meteor/packages/meteor-tool/.1.1.3.4sddkj++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/server-lib/node_modules/fibers/future.js:245
W20150609-12:22:56.529(-5)? (STDERR) throw(ex);
W20150609-12:22:56.529(-5)? (STDERR) ^
W20150609-12:22:56.531(-5)? (STDERR) ReferenceError: require is not defined
W20150609-12:22:56.531(-5)? (STDERR) at app/node_modules/multer/node_modules/busboy/node_modules/dicer/node_modules/streamsearch/lib/sbmh.js:5:20
W20150609-12:22:56.531(-5)? (STDERR) at app/node_modules/multer/node_modules/busboy/node_modules/dicer/node_modules/streamsearch/lib/sbmh.js:215:3
W20150609-12:22:56.531(-5)? (STDERR) at /home/eugene/dev/meteor/socially/.meteor/local/build/programs/server/boot.js:222:10
W20150609-12:22:56.531(-5)? (STDERR) at Array.forEach (native)
W20150609-12:22:56.532(-5)? (STDERR) at Function._.each._.forEach (/home/eugene/.meteor/packages/meteor-tool/.1.1.3.4sddkj++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/server-lib/node_modules/underscore/underscore.js:79:11)
W20150609-12:22:56.532(-5)? (STDERR) at /home/eugene/dev/meteor/socially/.meteor/local/build/programs/server/boot.js:117:5
What is the proper way to put these things together?
Don't install the
npm
package as a localnode_module
usingnpm install
.You need to specify the packages you want in a special file named
package.json
created after you addmeteorhacks:npm
and launch Meteor.https://github.com/meteorhacks/npm#defining-packages