TypeError:str.charCodeAt不是一个函数

我今天更新到节点版本6,可能已经打破了一些东西。 我试图回到节点5.10,但问题并没有消失。 这可能与节点v6发布的新V8引擎有关吗?

有没有人经历过这个? 任何想法?

最后一行我可以放置一个断点(在node_modules / superagent / lib / node / index.js中):

`if ('string' != typeof url) url = format(url);` 
  • variablesurl的值是一个string,看起来像一个有效的url
  • format()在url模块中作为urlFormat()

错误:

 TypeError: str.charCodeAt is not a function at encodeAuth (url.js:929:17) at Request.Url.format (url.js:543:12) at urlFormat (url.js:535:63) at new Request (/develop/sl/node_modules/superagent/lib/node/index.js:129:11) at request (/develop/sl/node_modules/superagent/lib/request.js:26:12) at Request.use (/develop/sl/node_modules/superagent/lib/request-base.js:65:3) ... 

更新:这可能与V8引擎无关,因为它仍然是v4,而不是新的v5。

 $ node -pe 'this.process.versions' { http_parser: '2.6.2', node: '5.10.1', v8: '4.6.85.31', uv: '1.8.0', zlib: '1.2.8', ares: '1.10.1-DEV', icu: '56.1', modules: '47', openssl: '1.0.2g' }