我尝试将 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/