I’ve been playing around with Meteor 1.3 and found the experience of being able to import npm modules as well as meteor packages to be very delightful.
I’m trying to use fibers/future on the server, and found lots of examples of Npm.require('fibers/future') Where does Npm come from, and how do I import it (or how do I import the fibers/future module)?
Because symbols imported using import are mutable bindings, a compiler for import statements needs the complete picture: not only what you imported and what module it came from, but where those symbols are used in the rest of your code. A REPL divorces the import statement from the symbol usage, making the compiler’s job impossible.
In short, when you’re using meteor shell, you need to use require.
Ok. But this is same on server.
I have import Future from 'fibers/future'; on server file and it gives me:
Unable to resolve some modules:
"fibers/future" in .../server/methods/uploads.js (os.linux.x86_64)
If you notice problems related to these missing modules, consider running:
meteor npm install --save fibers