node.js soap示例客户端无法运行

时间:2012-04-26 17:56:26

标签: node.js soap client

node client_soap.js 

node.js:249
        throw e; // process.nextTick error, or 'error' event on first tick
              ^
Error: Cannot find module './http'
    at Function._resolveFilename (module.js:333:15)
    at Function._load (module.js:280:25)
    at Module.require (module.js:357:17)
    at require (module.js:373:17)
    at Object.<anonymous> (/home/a1/mysourc3e/client_soap.js:6:12)
    at Module._compile (module.js:444:26)
    at Object..js (module.js:462:10)
    at Module.load (module.js:351:32)
    at Function._load (module.js:309:12)
    at module.js:482:10

npm list
/home/a1/mysourc3e
└─┬ soap@0.1.3 
  ├── node-expat@1.5.0 
  └── request@2.2.6 

我正在尝试使用soap运行node.js的示例代码。 我无法让https://github.com/milewise/node-soap/blob/master/lib/client.js工作。 我从哪里获得模块?

1 个答案:

答案 0 :(得分:0)

使用require('http')代替require('./http')

HTTP module is built in to node,所以你不应该告诉加载器在当前目录中查找它(如“./”前缀那样)。