npm install not working in npm 6.9.0 when authentication changes
See original GitHub issueDescribe the bug npm install is not working for npm v6.9.0 when the access is change from $all to particular users in config.yaml
To Reproduce Steps to reproduce the behavior:
-
In server: Go to ‘config.yaml’
-
In server: Under packages section grant the ‘access’ to one/many users (space separated) instead of $all. Something like
packages:
'@*/*':
# scoped packages
access: xxx yyy
publish: xxx
unpublish: xxx
proxy: npmjs
- In server: Optionally enable logs with
logs:
# - { type: stdout, format: pretty, level: info, path: verdaccio.log}
- {type: file, path: verdaccio.log, level: info}
-
In client: Login with username xxx or yyy. Login is successful
-
In client: run npm install
-
You will see
npm WARN @scope/package-name@0.1.7 No repository field.
npm ERR! code E401
npm ERR! Unable to authenticate, your authentication token seems to
be invalid.
npm ERR! To correct this please trying logging in again with:
npm ERR! npm login
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\User\AppData\Roaming\npm-cache\_logs\2019-07-09T14_38_41_734Z-debug.log
Expected behavior It should work and the package should be downloaded into node_modules as there is no problem if npm version is v3.10.10 (verified)
Update I have set this up(verdaccio) in my local machine running npm v6.9.0 and I tried running npm install in different machine in the same LAN. It works with both npm 3.10.10 and 6.9.0. May be this happens only in server which is running centos7(could be the reason) or verdaccio in external network (possibilities are there) . Hope this helps!
Issue Analytics
- State:
- Created 4 years ago
- Comments:19 (9 by maintainers)
Top GitHub Comments
This issue got fixed by adding
always-auth=true
in .npmrc file. To do so runnpm config set always-auth=true
from cmd.Thanks @juanpicado and @DanielRuf for your time and support.
Oh … 😃 Thanks for the feedback. Interesting.