我将node.js与google-translate-api包一起使用。
这一切都运行了好几个月,但突然间,我不知道为什么,简单的代码
translate("hello", {from: "en", to: "fr"}).then(res => {
console.log(res.text);
}).catch(err => console.log(err));
停止工作,我现在每次都会收到此错误:
在process._tickCallback(internal / process / next_tick.js:188:7)处的C:\ Users \ ... \ AutoTranslate \ node_modules \ google-translate-api \ index.js:105:17处出错:'BAD_REQUEST'
因此它不是由于我的代码,而是可能是节点的一些参数,但我不知道。从现在开始,使用异步调用的其他软件包会因同样的错误而崩溃。
我甚至尝试卸载节点并重新安装它,但我无法再次使用它。
谢谢!
答案 0 :(得分:1)
您的IP已被阻止,因此尝试与其他网络连接,它将正常工作