最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

installation - ADO Artifacts Scoped NPM Install 401 Error Using Mac - Stack Overflow

programmeradmin2浏览0评论

I have an artifact on ADO with published package @foo/bar

I followed the install instruction with

  1. one user .npmrc containing links, usernames, base-64 encoded pat token generated by ADO "install package" documentation, filling in the requisite fields

    ; begin auth token
    //pkgs.dev.azure/[org name]/[project id]/_packaging/[artifact feed name]/npm/registry/:username=[username]
    //pkgs.dev.azure/[org name]/[project id]/_packaging/[artifact feed name]/npm/registry/:_password=[BASE64_ENCODED_PERSONAL_ACCESS_TOKEN]
    //pkgs.dev.azure/[org name]/[project id]/_packaging/[artifact feed name]/npm/registry/:email=[email]
    //pkgs.dev.azure/[org name]/[project id]/_packaging/[artifact feed name]/npm/:username=[username]
    //pkgs.dev.azure/[org name]/[project id]/_packaging/[artifact feed name]/npm/:_password=[BASE64_ENCODED_PERSONAL_ACCESS_TOKEN]
    //pkgs.dev.azure/[org name]/[project id]/_packaging/[artifact feed name]/npm/:email=[email]
    ; end auth token
    
  2. one package - based .npmrc file containing the scope-prefaced registry

    @foo:registry=...
    always-auth=true
    
  3. I cloned project 'baz', cd'd into the directory and ran `npm install @foo/bar

Received 401 unauthorized when trying to install the package

I was expecting the package @foo/bar to be installed and listed in the package.json file

I tried:

  1. Adding a scope to the user-level .npmrc
  2. surrounding the base-64 auth token in quotes/brackets "[base-64-pat-token]"
  3. regenerating the pat token
  4. authenticating using `npm login --source @foo
    1. This resulted in infinite spinning with a masking of the project id on the cli due to auth policies preventing web-based access
  5. iterating on scope and registry.
    1. removed the scope altogether has the same result of 401
    2. logging in w/out --source resulted in the same as trying to login with --source when the source was included
发布评论

评论列表(0)

  1. 暂无评论