bower install > TypeError: msecs must be a number
bower install > TypeError: msecs must be a number
我最近升级到 node.js v0.12.7
,当我想将依赖项安装到项目文件夹时,bower install
出现问题:
$ bower install
timers.js:165
throw new TypeError('msecs must be a number');
^
TypeError: msecs must be a number
at Object.exports.enroll (timers.js:165:11)
at Socket.setTimeout (net.js:337:12)
at ClientRequest.<anonymous> (_http_client.js:565:10)
at ClientRequest.g (events.js:199:16)
at ClientRequest.emit (events.js:129:20)
at tickOnSocket (_http_client.js:493:7)
at _http_client.js:504:7
at process._tickCallback (node.js:355:11)
$ node --version
v0.12.7
我看到 node.js v0.12
存在一些相关问题,此错误消息表明 它需要带有 timeout
参数定义的选项。
所以我尝试在每个 .bowerrc
的文件夹父树中添加超时
{
"registry": "http://bower.mycompany.com",
"timeout": "15000",
"directory": "public/lib"
}
但它没有按预期工作。总是抛出同样的错误。
感谢 robertklep 的评论,我编辑了 .bowerrc
以匹配 定义和输入的数字!" 超时字段。
所以我为那些升级到node.js > v0.10
后出现同样错误的人澄清解决方案:
如果您的项目文件夹或父文件夹树中有一个 .bowerrc
文件,您必须用键入的数字 timeout
(例如 15000
)填充它,如下所示:
{
"timeout": 15000
}
我通过将超时作为数字而不是字符串传递来修复它(在错误中明确提到)
我在 emailjs
中遇到了类似的错误
timers.js:289
throw new TypeError('"msecs" argument must be a number');
^
TypeError: "msecs" argument must be a number
at Object.exports.enroll (timers.js:289:11)
at TLSSocket.Socket.setTimeout (net.js:321:12)
at new SMTPResponse (node_modules/emailjs/smtp/response.js:75:10)
at Object.exports.monitor (node_modules/emailjs/smtp/response.js:80:10)
at Object.SMTP.connect (node_modules/emailjs/smtp/smtp.js:163:33)
at Object.Client._connect (node_modules/emailjs/smtp/client.js:78:17)
at Object.Client._poll (node_modules/emailjs/smtp/client.js:28:18)
at node_modules/emailjs/smtp/client.js:115:21
at Object.Message.valid (node_modules/emailjs/smtp/message.js:180:10)
at Object.Client.send (node_modules/emailjs/smtp/client.js:93:14)
我想你可以使用
{
"registry": "http://bower.mycompany.com",
"timeout": 15000, //remove "
"directory": "public/lib"
}
代替:
{
"registry": "http://bower.mycompany.com",
"timeout": "15000",
"directory": "public/lib"
}
我最近升级到 node.js v0.12.7
,当我想将依赖项安装到项目文件夹时,bower install
出现问题:
$ bower install
timers.js:165
throw new TypeError('msecs must be a number');
^
TypeError: msecs must be a number
at Object.exports.enroll (timers.js:165:11)
at Socket.setTimeout (net.js:337:12)
at ClientRequest.<anonymous> (_http_client.js:565:10)
at ClientRequest.g (events.js:199:16)
at ClientRequest.emit (events.js:129:20)
at tickOnSocket (_http_client.js:493:7)
at _http_client.js:504:7
at process._tickCallback (node.js:355:11)
$ node --version
v0.12.7
我看到 node.js v0.12
存在一些相关问题,此错误消息表明 它需要带有 timeout
参数定义的选项。
所以我尝试在每个 .bowerrc
{
"registry": "http://bower.mycompany.com",
"timeout": "15000",
"directory": "public/lib"
}
但它没有按预期工作。总是抛出同样的错误。
感谢 robertklep 的评论,我编辑了 .bowerrc
以匹配 定义和输入的数字!" 超时字段。
所以我为那些升级到node.js > v0.10
后出现同样错误的人澄清解决方案:
如果您的项目文件夹或父文件夹树中有一个 .bowerrc
文件,您必须用键入的数字 timeout
(例如 15000
)填充它,如下所示:
{
"timeout": 15000
}
我通过将超时作为数字而不是字符串传递来修复它(在错误中明确提到) 我在 emailjs
中遇到了类似的错误timers.js:289
throw new TypeError('"msecs" argument must be a number');
^
TypeError: "msecs" argument must be a number
at Object.exports.enroll (timers.js:289:11)
at TLSSocket.Socket.setTimeout (net.js:321:12)
at new SMTPResponse (node_modules/emailjs/smtp/response.js:75:10)
at Object.exports.monitor (node_modules/emailjs/smtp/response.js:80:10)
at Object.SMTP.connect (node_modules/emailjs/smtp/smtp.js:163:33)
at Object.Client._connect (node_modules/emailjs/smtp/client.js:78:17)
at Object.Client._poll (node_modules/emailjs/smtp/client.js:28:18)
at node_modules/emailjs/smtp/client.js:115:21
at Object.Message.valid (node_modules/emailjs/smtp/message.js:180:10)
at Object.Client.send (node_modules/emailjs/smtp/client.js:93:14)
我想你可以使用
{
"registry": "http://bower.mycompany.com",
"timeout": 15000, //remove "
"directory": "public/lib"
}
代替:
{
"registry": "http://bower.mycompany.com",
"timeout": "15000",
"directory": "public/lib"
}