Yandex Cloud
Search
Contact UsGet started
  • Blog
  • Pricing
  • Documentation
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • ML & AI
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Customer Stories
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Education and Science
    • Yandex Cloud Partner program
  • Blog
  • Pricing
  • Documentation
© 2025 Direct Cursus Technology L.L.C.
Yandex Cloud Registry
  • Getting started
    • All guides
    • Creating a registry
        • Setting up npm
  • Access management
  • Pricing policy
  • CLI 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 22, 2025

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)
      1. Get an IAM token for the Yandex account or service account you are going to use for authentication.

      2. 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
        
      3. Create the NPM_AUTH environment variable containing the Base64-encoded iam:<IAM_token> line:

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

        Where <IAM_token> is the IAM token you got earlier.

      1. Get an IAM token for the Yandex account or service account you are going to use for authentication.

      2. 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_TOKEN}
        always-auth=true
        
      3. Create the NPM_AUTH_TOKEN environment variable containing the previously obtained IAM token:

        export NPM_AUTH_TOKEN="<IAM_token>"
        
      1. Get an OAuth token for the Yandex account you are going to use for authentication.

      2. 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
        
      3. Create the NPM_AUTH environment variable containing the Base64-encoded oauth:<OAuth_token> line:

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

        Where <OAuth_token> is the OAuth token you got earlier.

Was the article helpful?

Previous
Setting up Maven
Next
Overview
© 2025 Direct Cursus Technology L.L.C.