skip to Main Content

I have Azure feed with npm packages to which I’m connecting using Personal Access Token with Packaging read & write scope. Until recently, everything worked fine, but recently when trying to download packages I get an error:

npm ERR! code E403

npm ERR! 403 403 Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature. – GET https://pyvvsblobprodsu6weus63.blob.core.windows.net/…&rscd=attachment%3B%20filename%3D%22worker-farm-1.7.0.tgz%22

npm ERR! 403 In most cases, you or one of your dependencies are requesting

npm ERR! 403 a package version that is forbidden by your security policy, or

npm ERR! 403 on a server you do not have access to.

The token is valid. The download takes place via a proxy but it has been verified that the requests are not blocked. Do you have any ideas what could be causing this problem?

2

Answers


  1. Chosen as BEST ANSWER

    Thank you for your answer, but I already use PAT token. Currently, I don't publish any of my packages, I just use Azure Feed to download dependencies to build the project.


  2. Even I received the same error code as yours when, I tried to publish the package with same name and tried downloading it.

    In order to resolve this error and to download the existing packages from your feed refer the steps below:-

    enter image description here

    My .npmrc file:-

    registry=https://pkgs.dev.azure.com/sid24desai0738/AzureDevops/_packaging/LibWin64/npm/registry/ 
                            
    always-auth=true
    

    Use the command below to regenerate the credentials for your package:-

    vsts-npm-auth -config .npmrc //this failed so I used the next command with -force flag. 
    vsts-npm-auth -config .npmrc -force
    

    Then I tried publishing one new package and download one existing package from my feed and both of them were downloaded successfully

    npm publish  
    npm install [email protected]
    npm install [email protected]
    

    Output:-

    enter image description here

    enter image description here

    My package.json after npm install of both the packages from the feed:-

    {
      "name": "myexpressappsiddhesh",
      "version": "0.0.0",
      "private": false,
      "scripts": {
        "start": "cross-env NODE_ENV=production node ./bin/www"
      },
      "dependencies": {
        "cookie-parser": "~1.4.4",
        "cross-env": "^7.0.3",
        "debug": "~2.6.9",
        "ejs": "^3.1.9",
        "express": "^4.18.2",
        "expressappp1": "^1.0.0",
        "http-errors": "~1.6.3",
        "morgan": "~1.9.1",
        "myexpressappsiddhesh": "^0.0.0"
      }
    }
    

    If you are using other machine, Refer the steps in this section with the use of PAT token with Read & write access on Package:-

    enter image description here

    enter image description here

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search