AidanWelch / google-translate-api

An updated free and unlimited API for Google Translate :dollar: :no_entry_sign:
MIT License
143 stars 21 forks source link

google-translate-api-x gives below error #26

Closed nkpatel0801 closed 1 year ago

nkpatel0801 commented 1 year ago

error: node_modules/google-translate-api-x/lib/Translator.cjs: /home/nirali/Desktop/farmerAssistantApp/node_modules/google-translate-api-x/lib/Translator.cjs: Class private methods are not enabled. Please add @babel/plugin-proposal-private-methods to your configuration.

AidanWelch commented 1 year ago

This project doesn't use babel. That should be configured in the implementation-end.

AidanWelch commented 1 year ago

You should just be able to install it like this https://babeljs.io/docs/babel-preset-env

AidanWelch commented 1 year ago

Actually that started having more issues such as require not defined but

babel.config.js

module.exports = function(api) {
  api.cache(true);
  return {
    presets: ['babel-preset-expo'],
    plugins: [["@babel/plugin-proposal-private-methods", { "loose": true }]],
  };
};

works fine