vitalets / google-translate-api

A free and unlimited API for Google Translate :dollar: :no_entry_sign:
MIT License
936 stars 120 forks source link

Issue with Node Js v12 #113

Closed sinta3 closed 1 year ago

sinta3 commented 1 year ago

return error when run in docker, with node version 12

2023-05-09 10:08:56 /app/node_modules/@vitalets/google-translate-api/dist/cjs/helpers.js:5 2023-05-09 10:08:56 const ip = html.match(/IP address: (.+?)
/)?.[1] || ''; 2023-05-09 10:08:56 ^ 2023-05-09 10:08:56 2023-05-09 10:08:56 SyntaxError: Unexpected token '.' 2023-05-09 10:08:56 at wrapSafe (internal/modules/cjs/loader.js:915:16) 2023-05-09 10:08:56 at Module._compile (internal/modules/cjs/loader.js:963:27) 2023-05-09 10:08:56 at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10) 2023-05-09 10:08:56 at Module.load (internal/modules/cjs/loader.js:863:32) 2023-05-09 10:08:56 at Function.Module._load (internal/modules/cjs/loader.js:708:14) 2023-05-09 10:08:56 at Module.require (internal/modules/cjs/loader.js:887:19) 2023-05-09 10:08:56 at require (internal/modules/cjs/helpers.js:74:18) 2023-05-09 10:08:56 at Object. (/app/node_modules/@vitalets/google-translate-api/dist/cjs/index.js:9:22) 2023-05-09 10:08:56 at Module._compile (internal/modules/cjs/loader.js:999:30) 2023-05-09 10:08:56 at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)

vitalets commented 1 year ago

Node 12 is deprecated and ended security support a year ago. If possible I would suggest to upgrade Node.

I will add minimal node version check to package.json.

sinta3 commented 1 year ago

thank youu mr vitaliy!