_meteor_bootstrap_.require not working in Meteor 0.6.4.1

百般思念 提交于 2019-12-13 04:32:48

问题


The code I inherited use _meteor_bootstrap.require, an internal meteor details, to load module. Look like it's no longer working with 0.6.4.1? any suggestions of how I should load modules?

Current code require = meteor_bootstrap.require
Future = require (fibers/future)

The error message I got: C:\Program Files (x86)\Meteor\lib\node_modules\fibers\future.js:173
throw(ex);
^
TypeError: undefined is not a function
at app/server/main.coffee.js:7:10
at C:\Users\jhuang\Documents\Tervela\5.0.16\i32\lib.meteor\local\build\server\server.js:306:12
at Array.forEach (native)
at Function..each..forEach (C:\Program Files (x86)\Meteor\lib\node_modules\underscore\underscore.js:78:11)
at run (C:\Users\jhuang\Documents\Tervela\5.0.16\i32 \lib.meteor\local\build\server\server.js:239:7)
=> Exited with code: 1
=> Your application is crashing. Waiting for file change.


回答1:


From v 0.6.0

Packages may depend on NPM modules, using the new Npm.depends directive in their package.js

Once included, package code can use Npm.require to pull in the module.

Future = Npm.require("fibers/future")

If you need to use this npm module in your app. Use meteor-npm

Future = Meteor.require("fibers/future")


来源:https://stackoverflow.com/questions/18130345/meteor-bootstrap-require-not-working-in-meteor-0-6-4-1

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!