Search code examples
node.jsbad-request

node.js | BAD_REQUEST error suddenly appeared


I use node.js with the google-translate-api package.

It all worked fine for months but suddenly and I can't tell why, the simple code

translate("hello", {from: "en", to: "fr"}).then(res => {
    console.log(res.text);
}).catch(err => console.log(err));

stopped working and I get this error everytime now :

Error at C:\Users\...\AutoTranslate\node_modules\google-translate-api\index.js:105:17 at at process._tickCallback (internal/process/next_tick.js:188:7) code: 'BAD_REQUEST'

Therefore it is not due to my code but probably to some parameters of node but I don't know. From now on, other packages which use async calls crash with the same error.

I even tried to uninstall node and reinstall it but I can't make it to work again.

Thanks!


Solution

  • Your Ip has been blocked so try to connect with other network it will work fine