Yandex Cloud
Search
Contact UsTry it for free
  • Customer Stories
  • Documentation
  • Blog
  • All Services
  • System Status
  • Marketplace
    • Featured
    • Infrastructure & Network
    • Data Platform
    • AI for business
    • Security
    • DevOps tools
    • Serverless
    • Monitoring & Resources
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Center for Technologies and Society
    • Yandex Cloud Partner program
    • Price calculator
    • Pricing plans
  • Customer Stories
  • Documentation
  • Blog
© 2026 Direct Cursus Technology L.L.C.
Yandex Cloud Registry
  • Getting started
    • All guides
    • Creating a registry
        • Setting up npm
  • Access management
  • Pricing policy
  • Terraform reference
  • Audit Trails events
  1. Step-by-step guides
  2. Managing artifacts
  3. Node.js artifact
  4. Setting up npm

Setting up npm

Written by
Yandex Cloud
Updated at January 20, 2026

To do the setting up:

  • For all projects: run this command:

    npm config set registry https://registry.yandexcloud.net/npm/<registry_ID>

  • For one project:

    1. Open the .npmrc file in the project root.

    2. Depending on the authentication method:

      IAM token (Base64)
      IAM_token
      OAuth token (Base64)
      API key (Base64)
      1. Get an IAM token for the Yandex account or service account you are going to use for authentication.

      2. Create the NPM_AUTH environment variable:

        export NPM_AUTH=$(echo -n 'iam:<IAM_token>' | base64)
        

        Where NPM_AUTH is the body of the previously obtained IAM token, Base64-encoded.

      3. Add the following lines to the previously created .npmrc file:

        registry=https://registry.yandexcloud.net/npm/<registry_ID>
        //registry.yandexcloud.net/npm/:_auth=${NPM_AUTH}
        always-auth=true
        
      1. Get an IAM token for the Yandex account or service account you are going to use for authentication.

      2. Create the NPM_AUTH environment variable:

        export NPM_AUTH="<IAM_token>"
        

        Where NPM_AUTH is the body of the previously obtained IAM token.

      3. Add the following lines to the previously created .npmrc file:

        registry=https://registry.yandexcloud.net/npm/<registry_ID>
        //registry.yandexcloud.net/npm/:_authToken=${NPM_AUTH}
        always-auth=true
        
      1. Get an OAuth token for the Yandex account you are going to use for authentication.

      2. Create the NPM_AUTH environment variable:

        export NPM_AUTH=$(echo -n 'oauth:<OAuth_token>' | base64)
        

        Where NPM_AUTH is the body of the previously obtained OAuth token, Base64-encoded.

      3. Add the following lines to the previously created .npmrc file:

        registry=https://registry.yandexcloud.net/npm/<registry_ID>
        //registry.yandexcloud.net/npm/:_auth=${NPM_AUTH}
        always-auth=true
        
      1. Create an API key for the service account you are going to use for authentication.

      2. Create the NPM_AUTH environment variable:

        export NPM_AUTH=$(echo -n 'api_key:<API_key>' | base64)
        

        Where NPM_AUTH is the body of the previously created API key, Base64-encoded.

      3. Add the following lines to the previously created .npmrc file:

        registry=https://registry.yandexcloud.net/npm/<registry_ID>
        //registry.yandexcloud.net/npm/:_auth=${NPM_AUTH}
        always-auth=true
        

Was the article helpful?

Previous
Setting up Maven
Next
Setting up NuGet
© 2026 Direct Cursus Technology L.L.C.