I want to use http2 for client side in my angular project.
const http2 = require("http2");
const client = http2.connect("http://localhost:8443");
const req = client.request({
":path": "/"
});
When I wrote this code block for http2 request, I get error Module not found: Error: Can't resolve 'http2' in '/path' .
There was http2 package ("npm install http2" command), but this package showing "This package has been deprecated" and "Use the built-in module in node 9.0.0 or newer, instead". Thus, I cannot use this package.
Thus, I cannot get data from server using http2 client like nodejs. How can I fix these problem?
- Node version: v13.3.0
- npm version: 6.13.1
- @angular/cli: "~7.3.7"