I want to use an api and here is my code:
translate(sentence:string){
const translate = require('translate-api');
let transText = sentence;
translate.getText(transText,{to: 'zh-CN'}).then(function(text: any){
console.log(text)
});}
The problem is that when I run the application with ng serve --open, I get this error message:
BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default. This is no longer the case. Verify if you need this module and configure a polyfill for it. If you want to include a polyfill, you need to: - add a fallback 'resolve.fallback: { "http": require.resolve("stream-http") }' - install 'stream-http' If you don't want to include a polyfill, you can use an empty module like this: resolve.fallback: { "http": false }
I understood that I had to add 'resolve.fallback: { "http": require.resolve("stream-http") }' somewhere, but I don't see where.
I can't find a solution specifically for angular and I can't adapt them.
I'm a beginner please be lenient. I thank you for your help.
Edit: to work around the problem I'm having with Angular-CLI version 13, I went back to the previous version. It works for me. But I still have no solution if I want to use version 13.