handlebars.js未捕获TypeError:对象#<Object>没有方法'call'

Mar*_*Dev 6 javascript node.js backbone.js handlebars.js

有人帮忙解决handlebars.js的问题吗?

我正在使用在Centos 6.4上运行的handlebars预编译模板.要安装这个我安装:

  1. npm:yum -y --enablerepo = epel install npm
  2. 首先继承以避免问题:npm install -g inherits
  3. 然后把手本身:npm install -g把手

这给出了以下版本:

  • handlebars@2.0.0-alpha.1/usr/lib/node_modules/handlebars
  • optimist@0.3.7(wordwrap@0.0.2)
  • uglify-js@2.3.6(async@0.2.10,source-map@0.1.31)

我正在使用requirejs在应用程序中加载以下内容:

  • jQuery v1.11.0
  • Underscore.js 1.6.0
  • 车把v1.3.0(带amd)
  • backbone.js 1.1.0

有没有人有一组可以协同工作的版本号?

谢谢!

Mar*_*Dev 17

这是服务器上的把手版本.NPM默认安装最新版本,版本2 alpha导致问题.在Github上找到此修复程序(https://github.com/wycats/handlebars.js/issues/734):

  1. npm uninstall handlebars -g
  2. npm install handlebars@1.3 -g

好像现在工作正常,重新开始工作!

(感谢Mahesh的指针.)