为什么运行下面显示的代码会出错?(它用于Coursera的Stanford'Startup engineering'课程中的一个作业:https://class.coursera.org/startup-001/quiz/attempt ? quiz_id = 149 )
这个课程是在2013年6月 - 6月进行的,所以可能有节点或csv的更新可能会打破脚本吗?作业不是关于修复脚本,所以这个问题不是'作弊',而且课程目前还没有运行..
因此,环境是:Ubuntu 14.04(内核3-13-0-29-通用),节点v0.11.13,npm v1.4.9
我npm install在主目录中有'csv,accounting util和restler,脚本也在那里.
这让我完全难过...... :-(
错误信息:
[ubuntu@ip-xxx-xxx-xxx-xxx:~]$node market-research.js
Invoked at command line.
Wrote market-research.csv
Symbol Name Market Cap Previous Close Price P/E Ratio Shares EPS Earnings
/home/ubuntu/market-research.js:47
csv()
^
TypeError: object is not a function
at csv2console (/home/ubuntu/market-research.js:47:5)
at Request.response2console (/home/ubuntu/market-research.js:65:13)
at Request.EventEmitter.emit (events.js:110:17)
at Request.mixin._fireSuccess (/home/ubuntu/node_modules/restler/lib/restler.js:226:10)
at /home/ubuntu/node_modules/restler/lib/restler.js:158:20
at IncomingMessage.parsers.auto (/home/ubuntu/node_modules/restler/lib/restler.js:394:7)
at Request.mixin._encode (/home/ubuntu/node_modules/restler/lib/restler.js:195:29)
at /home/ubuntu/node_modules/restler/lib/restler.js:154:16
at Request.mixin._decode (/home/ubuntu/node_modules/restler/lib/restler.js:170:7)
at IncomingMessage.<anonymous> (/home/ubuntu/node_modules/restler/lib/restler.js:147:14) …Run Code Online (Sandbox Code Playgroud)