node.js - Meteor下划线无法调用未定义的方法 'exports'

标签 node.js backbone.js meteor underscore.js

我尝试将 underscore-string-latest 包与 Meteor 一起使用,但在开始时出现以下错误:

W20140316-01:08:50.265(8)? (STDERR) /Users/test1/.meteor/tools/f3947a4651/lib/node_modules/fibers/future.js:173
W20140316-01:08:50.265(8)? (STDERR)                         throw(ex);
W20140316-01:08:50.266(8)? (STDERR)                               ^
W20140316-01:08:50.269(8)? (STDERR) TypeError: Cannot call method 'exports' of undefined
W20140316-01:08:50.269(8)? (STDERR)     at Package (packages/underscore-string-latest/post.js:8)
W20140316-01:08:50.269(8)? (STDERR)     at packages/underscore-string-latest.js:80:4
W20140316-01:08:50.269(8)? (STDERR)     at packages/underscore-string-latest.js:89:3
W20140316-01:08:50.270(8)? (STDERR)     at /private/var/folders/__/74f_y9md49507s3q616snqw00000gn/T/meteor-test-run1no1trz/.meteor/local/build/programs/server/boot.js:155:10
W20140316-01:08:50.270(8)? (STDERR)     at Array.forEach (native)
W20140316-01:08:50.270(8)? (STDERR)     at Function._.each._.forEach (/Users/gunjan/.meteor/tools/f3947a4651/lib/node_modules/underscore/underscore.js:79:11)
W20140316-01:08:50.270(8)? (STDERR)     at /private/var/folders/__/74f_y9md49507s3q616snqw00000gn/T/meteor-test-run1no1trz/.meteor/local/build/programs/server/boot.js:82:5
=> Exited with code: 8

请帮助建议解决此问题。

谢谢

最佳答案

您可以尝试删除该包并将该库作为项目的一部分包含在内。例如,创建一个 lib/underscore-string 文件夹并将 underscore.string.js 放入其中,客户端和服务器都可以访问它。

关于node.js - Meteor下划线无法调用未定义的方法 'exports',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22432797/

相关文章:

Node.js 类型错误 : Cannot read property 'path' of undefined

mysql - 哪个数据库适合我的应用程序 mysql 或 mongodb ?使用 Node.js 、 Backbone 、 Now.js

javascript - 缩放 meteor (非技术人员的问题)

Node.js:查询中的数组

node.js - 如何升级 AWS OpsWorks 中实例的 Node 版本

javascript - javascript `_|_` 是什么?

html - 如何更改登录表单的形状?帐户输入和 meteor

使用 Jasmine 测试 Backbone 模型的触发方法

javascript - CompositeView 为大型结果集 Marionette 呈现项目的速度很慢

Meteor/accounts-google : Where is the client secret stored? 安全吗?