简体   繁体   English

Derby.js TypeError:对象函数(文件)

[英]Derby.js TypeError: Object function (files)

Everytime I try to run the basic server.js that comes with a new project I ge the following errors: 每当我尝试运行新项目随附的基本server.js时,都会发生以下错误:

node server.js

Master pid 5078
   info  - socket.io started
5079 listening. Go to: http://localhost:3000/

../node_modules/derby/node_modules/racer/lib/racer.server.js:115
  callback(err, value + ';' + browserify.bundle(options));
                                         ^
TypeError: Object function (files) {
    return new Browserify(files);
} has no method 'bundle'
    at racer.js (../node_modules/derby/node_modules/racer/lib/racer.server.js:115:46)
    at module.exports (../node_modules/derby/node_modules/racer/node_modules/socket.io-client/bin/builder.js:244:7)
    at fs.readFile (fs.js:176:14)
    at Object.oncomplete (fs.js:297:15)

I have tried to re-install node.js and derby with and without the -g option and always get the same problem. 我尝试使用-g选项和不使用-g选项重新安装node.js和derby,并且总是遇到相同的问题。 Am I doing something wrong? 难道我做错了什么?

EDIT: Using node.js 0.8.20 and derby.js 0.3.14 on OSX 10.8.2 编辑:在OSX 10.8.2上使用node.js 0.8.20和derby.js 0.3.14

I have run into the same problem today. 我今天遇到了同样的问题。 I don't think you are doing anything wrong. 我认为您没有做错任何事情。 The maintainers of browserify have released a new version which I think has changed its API. browserify的维护者发布了一个新版本,我认为它已经更改了它的API。

I'm new to derby too, and not that proficient at Javascript either. 我也是derby的新手,也不太精通Javascript。 I did manage to work around this problem at least for now by hacking in to {project_home}/node_modules/derby/node_modules/racer/package.json and changing the version for browserify back to something that I had working. 至少到目前为止,我确实设法解决了这个问题,方法是入侵{project_home} /node_modules/derby/node_modules/racer/package.json,然后将browserify的版本更改回我可以使用的版本。

"browserify": "1.17.2",

Not a long term solution though. 虽然不是长期的解决方案。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM