[BUG] npm install in quick start guide broken
While walking through the quickstart guide I was unable to npm install the lit sample code.
$ npm install
npm warn deprecated [email protected]: Use your platform's native DOMException instead
npm error code E401
npm error Incorrect or missing password.
npm error If you were trying to login, change your password, create an
npm error authentication token or enable two-factor authentication then
npm error that means you likely typed your password in incorrectly.
npm error Please try again, or recover your password at:
npm error https://www.npmjs.com/forgot
npm error
npm error If you were doing some other operation then your saved credentials are
npm error probably out of date. To correct this please try logging in again with:
npm error npm login
npm error A complete log of this run can be found in: /Users/sambetts/.npm/_logs/2025-12-16T10_44_01_722Z-debug-0.log
Error from the debug log:
447 verbose stack HttpErrorAuthUnknown: Unable to authenticate, need: Basic realm="https://us-npm.pkg.dev"
447 verbose stack at /opt/homebrew/Cellar/node@22/22.20.0_1/lib/node_modules/npm/node_modules/npm-registry-fetch/lib/check-response.js:88:17
447 verbose stack at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
448 verbose statusCode 401
449 verbose pkgid yargs-parser@https://us-npm.pkg.dev/artifact-foundry-prod/ah-3p-staging-npm/yargs-parser/-/yargs-parser-21.1.1.tgz
450 error code E401
451 error Incorrect or missing password.
452 error If you were trying to login, change your password, create an
452 error authentication token or enable two-factor authentication then
452 error that means you likely typed your password in incorrectly.
452 error Please try again, or recover your password at:
452 error https://www.npmjs.com/forgot
452 error
452 error If you were doing some other operation then your saved credentials are
452 error probably out of date. To correct this please try logging in again with:
452 error npm login
I double checked that I have no ~/.npmrc file configured to rule out that there was some invalid credentials stored.
As a debug setup I removed package-lock.json, after that npm install was successful. I think the package-lock.json might have repos which require login stored in it, specifically https://us-npm.pkg.dev.
This is a snippet of the lock file diff after I successfully installed:
"node_modules/yargs-parser": {
"version": "21.1.1",
- "resolved": "https://us-npm.pkg.dev/artifact-foundry-prod/ah-3p-staging-npm/yargs-parser/-/yargs-parser-21.1.1.tgz",
+ "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz",
"integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==",
"dev": true,
"license": "ISC",
Hello, maintainers
Package-lock.json, which contains resolved URLs pointing to the private registry https://us-npm.pkg.dev, is what causes the npm install failure. This requires authentication and leads to:
npm ERR! E401 Not able to authenticate
This occurs as a result of the lock file being created in a private npm registry environment, which has an impact on new clones and continuous integration.
Suggested solution:
Use the public registry to generate package-lock.json (https://registry.npmjs.org).
Make sure there are no more private registry URLs.
This modification lets npm install function right out of the box and only modifies the lock file.
### Could you please assign me this issue? I'd be happy to make this change and open a PR.