流星下划线无法调用未定义的方法'exports'

时间:2014-03-16 04:01:30

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

我尝试在流星上使用下划线字符串最新包,但在开始时我遇到错误:

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

请帮助建议解决此问题。

由于

1 个答案:

答案 0 :(得分:1)

您可以尝试删除软件包,只是将库包含在项目中。例如,创建一个lib/underscore-string文件夹并将underscore.string.js放在那里,它可以在客户端和服务器上访问。