'How can I monitor the requests during 'npm install <package>'?

I wish to monitor the calls made by the npm cli to the npm registry.

(I am building my own registry)

I have tried using a program, Charles for monitoring requests on my machine, (Macbook Pro 2021 Monterey), but no requests of interest appeared while using the npm cli. I also tried using Activity Monitor native to macOS, but I could not figure out how to identify the requests.

I have also tried installing Wireshark, but I am unable to gain access rights to monitor requests.

How can I monitor requests during 'npm install '?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source