d3.scale 使用 express 未定义

d3.scale is undefined using express

我正在尝试使用 node.js 和 express 在我的 Web 应用程序中绑定 c3-chart。但是 c3.js 文件给出了以下错误信息:

TypeError: d3.scale is undefined

下面是我的 layout.yade 文件:

doctype html
html
  head
    title= title
    link(rel='stylesheet', href='http://cdn.leafletjs.com/leaflet/v0.7.7/leaflet.css')
    link(rel='stylesheet', href='/stylesheets/c3.css')
    link(rel='stylesheet', href='/stylesheets/style.css')
    script(src='http://cdn.leafletjs.com/leaflet/v0.7.7/leaflet.js')
    script(src='/javascripts/leaflet.ajax.js')  
    script(src='http://d3js.org/d3.v3.min.js')
    script(src='/javascripts/c3.min.js')
    script(src='/javascripts/jquery.js')

  body
    block content

我解决了,对于那些有同样问题的人,你可以找到正确的顺序和正确版本的库:

doctype html
html
head
    title= title
    link(rel='stylesheet', href='http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.css')
    link(rel='stylesheet', href='/stylesheet/c3.css')
    link(rel='stylesheet', href='/stylesheets/style.css')
    script(src='http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.js')
    script(src='/javascripts/c3.min.js')
    script(src='/javascripts/leaflet.ajax.js')
    script(src='http://d3js.org/d3.v3.min.js' charset='utf-8')
    script(src='/javascripts/jquery.js')
body
    block content