node.js - 该平台不支持代理

标签 node.js meteor ddp

我正在尝试制作(我不知道它叫什么,热加载?热重载?)类似 Meteor 的数据实时加载,但是使用的是 Node.js 而不是 Meteor。
我正在使用 ddp客户端模块(=浏览器,我还没有尝试过)和 ddp-reactive-server ,好吧,对于服务器来说。

server.js 是这样的:

var DDPServer = require('ddp-server-reactive');

var server = new DDPServer();



var todoList = server.publish('todolist');    

之后,我使用命令 node server.js --harmony_proxies 运行服务器(注意我已经在使用该标志),这就是我得到的:

[aseds@localhost ~]$ node server.js --harmony_proxies
/home/aseds/Desktop/projeh/css-goodness/node_modules/harmony-reflect/reflect.js:2049
      throw new Error("proxies not supported on this platform. On v8/node/iojs, make sure to pass the --harmony_proxies flag");
      ^

Error: proxies not supported on this platform. On v8/node/iojs, make sure to pass the --harmony_proxies flag
    at global.Proxy (/home/aseds/Desktop/projeh/css-goodness/node_modules/harmony-reflect/reflect.js:2049:13)
    at publish (/home/aseds/Desktop/projeh/css-goodness/node_modules/ddp-server-reactive/lib.js:211:32)
    at Object.<anonymous> (/home/aseds/Desktop/projeh/css-goodness/ddpserver.js:10:23)
    at Module._compile (module.js:397:26)
    at Object.Module._extensions..js (module.js:404:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Function.Module.runMain (module.js:429:10)
    at startup (node.js:139:18)
    at node.js:999:3

我的nodejs版本v5.4.1。 我什至不确定是否真的可以通过这种方式实现 Meteor 的自动重新加载功能,但我正在尝试! :)

预先感谢您提供的任何帮助。

最佳答案

我遇到了这个关于 --harmony-proxies 的帖子:

https://github.com/tvcutsem/harmony-reflect/issues/56

相关位:

I released version 1.4.0 which, when loaded twice according to the script outlined above, loads correctly.

Note that loading v1.3.1 of this library followed by v1.4.0 will still fail (the other way around works fine). So it's important that your dependencies upgrade to the latest version.

如果 Harmony-proxies 作为 Node 依赖项加载两次,需要不同的版本,并且首先加载 1.4.0 之前的版本,那么您将看到此错误。

关于node.js - 该平台不支持代理,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34844996/

相关文章:

javascript - Nodejs Sequelize中循环获取异步数据

javascript - Meteor 是否对模板名称强制使用 CamelCase?

android - 部署 meteor 应用程序后无法使用 android-ddp 连接到 meteor

meteor - 同一主机上容器之间的 meteor DDP调用

node.js - SailsJs 中填充了什么?

node.js - 我怎样才能解决这个问题? @ grpc/grpc-js仅适用于 Node ^ 8.13.0 || > = 10.10.0

node.js - 错误: Cannot find module '…/webpack' Vue js

meteor - 如何排除 meteor 测试并仅运行包测试( meteor 0.6.0+)

node.js - 在 Meteor.startup 在 Meteor 应用程序中运行服务器端之前,在单独文件中声明的集合未加载

Meteor 和 C nopoll 应用程序之间的连接丢失