How to set up a private npm registry: from install to .npmrc, scope, and publish

After self-hosting, wire npm: create HOSTED/PROXY/GROUP, configure .npmrc and scope, smoke-test with a minimal package, and fix E401, E404, and E409.