Summary: Attempting to run server-side modules in a browser will not succeed.
It seems like you're trying to incorporate server-side JavaScript modules into a browser environment, which is not feasible due to the limited capabilities of browsers in terms of network connections and local file system access.
The dependency http
that you are mentioning belongs to the Node standard library and is readily available for Node applications running on the server-side.
In this scenario, you might have thought that installing a separate package like this package was necessary because require('http')
did not work in the browser.
Even if this additional package were functioning correctly (which it isn't), it still would not be able to function within a browser environment as it relies on other modules from the Node standard library that are not accessible in a browser.
It's uncertain whether CouchDB offers its own REST API that can be utilized directly in the browser. If not, you'll need to develop a server-side API to serve as an intermediary between the browser and CouchDB.