ArcGIS REST JS divides functionality into separate packages. All packages have a peer dependency on @esri/arcgis-rest-request. You can refer to each packge for specific installation directions.
@esri/arcgis-rest-request: Core package containing request/response processing, authentication helpers and error handling.
To use ArcGIS REST JS as ES Modules you must specify type: "module" in your package.json file or name your file with the .mjs extension. See the Node.js ES module documentation for more details.
Browsers
For browsers ArcGIS REST JS is distributed as both ES modules which should work "out-of-the-box" with most popular module bundlers and as UMD (universal module definition) files which should work as both a browser global or with older module bundlers.
ES modules
ArcGIS REST JS should work out-of-the-box with most popular bundlers that support ES modules. Demos showing integrations with specific tools in the ArcGIS REST JS GitHub repo.
Using ArcGIS REST JS from a CDN is a viable option for demos and smaller applications. ArcGIS REST JS uses 2 CDNs unpkg which can be used with a simple script tag and Skypack which is optimized for serving ES modules.
While the import map specification is not yet supported by all browsers it can be used with polyfills from services such as JSPM which can generate the proper import map.