geocodeearth / autocomplete-element

A custom element for use with the Geocode Earth Autocomplete API.
https://geocode.earth
MIT License
8 stars 1 forks source link

npm install fails with E401 #11

Open missinglink opened 3 years ago

missinglink commented 3 years ago

When running npm install on the repo I'm getting an "Incorrect or missing password" error from npm.

Deleting the package-lock.json file resolves the issue and allows me to install the dependencies.

/code/ge/autocomplete-element main ❯ git log -1 
commit 581c95f8d1ff6f81a9effb1fdf819afaf9b98599 (HEAD -> main, tag: v0.0.9, origin/main, origin/HEAD)
/code/ge/autocomplete-element main ❯ npm install
npm ERR! code E401
npm ERR! Incorrect or missing password.
npm ERR! If you were trying to login, change your password, create an
npm ERR! authentication token or enable two-factor authentication then
npm ERR! that means you likely typed your password in incorrectly.
npm ERR! Please try again, or recover your password at:
npm ERR!     https://www.npmjs.com/forgot
npm ERR!
npm ERR! If you were doing some other operation then your saved credentials are
npm ERR! probably out of date. To correct this please try logging in again with:
npm ERR!     npm login

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/peter/.npm/_logs/2021-06-22T11_57_29_872Z-debug.log
missinglink commented 3 years ago

Here's a docker one-liner which can be used to reproduce this issue:

docker run \
  --rm -it \
  -v "${PWD}:/code" \
  --entrypoint='bash' \
  node:latest \
  -c 'cd /code; rm -rf node_modules; npm install'

changing the last line to remove package-lock.json resolves the issue:

-c 'cd /code; rm -rf node_modules; rm package-lock.json; npm install'

something funky is going on with npm, possibly from back when either geocodeearth/autocomplete-element or geocodeearth/core-js were in development and were private.

I noticed for geocodeearth/ge that I needed to add the following settings to my package.json because npm appeared to publish org scoped packages as private by default.

 "publishConfig": {
    "access": "public"
  }
HeatherSpicher commented 1 year ago

Thank you so much!!! I tried so many other fixes that didn't work and this was the fix! Thanks!