_meteor_bootstrap_.require 在 Meteor 0.6.4.1 中不起作用 [英] _meteor_bootstrap_.require not working in Meteor 0.6.4.1

查看:42
本文介绍了_meteor_bootstrap_.require 在 Meteor 0.6.4.1 中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我继承的代码使用_meteor_bootstrap.require,一个内部流星细节,来加载模块.看起来它不再适用于 0.6.4.1?我应该如何加载模块的任何建议?

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?

当前代码需要=meteor_bootstrap.require
未来 = 要求(纤维/未来)

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

我收到的错误信息:C:\Program Files (x86)\Meteor\lib\node_modules\fibers\future.js:173
抛出(前);
^
类型错误:未定义不是函数
在应用程序/服务器/main.coffee.js:7:10
在 C:\Users\jhuang\Documents\Tervela\5.0.16\i32\lib.meteor\local\build\server\server.js:306:12
在 Array.forEach(本机)
在 Function..each..forEach (C:\Program Files (x86)\Meteor\lib\node_modules\underscore\underscore.js:78:11)
运行时 (C:\Users\jhuang\Documents\Tervela\5.0.16\i32\lib.meteor\local\build\server\server.js:239:7)
=> 退出代码:1
=> 您的应用程序崩溃了.等待文件更改.

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.

推荐答案

来自 v 0.6.0

包可能依赖于 NPM 模块,使用新的 Npm.depends指令在他们的 package.js

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

一旦包含,包代码就可以使用 Npm.require 拉入模块.

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

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

如果你需要在你的应用中使用这个 npm 模块.使用 meteor-npm

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

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

这篇关于_meteor_bootstrap_.require 在 Meteor 0.6.4.1 中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆